100888 Commits

Author SHA1 Message Date
ray
878cc3db14 MFC r268981
Remove #ifdef-s to reduce difference to upstream.

Pointed by:     kib
Approved by:    re (glebius)

Sponsored by:	The FreeBSD Foundation
2014-09-25 13:08:31 +00:00
mav
5f1a68aede MFC r271957: Fix read overrun handling, broken by using wrong variable.
Approved by:	re (marius)
2014-09-25 09:12:11 +00:00
mav
9f773a51bb MFC r271949:
Fix UNMAP stuck if the last block descriptor in the list is empty.

Approved by:	re (glebius)
2014-09-25 09:11:01 +00:00
hselasky
fd7a3a7bfd MFC r271953:
Some XHCI hardware requires dropping the endpoint context before
adding it again.

Approved by:	re, glebius
2014-09-25 07:37:41 +00:00
bz
26cc830ced This is a direct commit rather than an MFC of r271744.
Re-gen after r272020 (r271743 in head) implementing most of
  timer_{create,settime,gettime,getoverrun,delete}.

Approved by:	re (gjb)
Sponsored by:	DARPA/AFRL
2014-09-23 07:53:32 +00:00
bz
cbd13542a7 MFC r271743:
Implement most of timer_{create,settime,gettime,getoverrun,delete}
  for amd64/linux32.  Fix the entirely bogus (untested) version from
  r161310 for i386/linux using the same shared code in compat/linux.

  It is unclear to me if we could support more clock mappings but
  the current set allows me to successfully run commercial
  32bit linux software under linuxolator on amd64.

  Reviewed by:			jhb
  Differential Revision:	D784
Sponsored by:			DARPA, AFRL
Approved by:			re (gjb)
2014-09-23 07:50:04 +00:00
cperciva
925d357775 MFC r271664:
Cache GELI passphrases entered at the console during the boot process,
  in order to improve user-friendliness when a system has multiple disks
  encrypted using the same passphrase.

Relnotes:	yes
Approved by:	re (gjb)
2014-09-23 00:43:18 +00:00
davidcs
66312b96c4 MFC r271728
For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message.

Approved by:	re(gjb)
2014-09-22 21:12:30 +00:00
davidcs
d20542b56a MFC r271727
remove clean option from Makefile

Approved by:	re(gjb)
2014-09-22 20:53:17 +00:00
jhb
09bff45095 MFC 270850,271053,271192,271717:
Save and restore FPU state across suspend and resume on i386.
- Create a separate structure for per-CPU state saved across suspend and
  resume that is a superset of a pcb.
- Store the FPU state for suspend and resume in the new structure
  (for amd64, this moves it out of the PCB)
- On both i386 and amd64, all of the FPU suspend/resume handling is now
  done in C.

Approved by:	re (hrs)
2014-09-22 20:34:36 +00:00
marcel
33a793a3e6 Make sure all memory updates are made visible before we let go
of the thread in cpu_switch(). It's otherwise possible that on
another CPU the thread continues from stale context data.

Note that this is prominent on newer CPUs, like the Montecito,
that really take advantage of the weak memory ordering. First
generation Itanium 2 is not that aggressive and does not need
this.

This is a direct commit to stable/10.

Approved by:	re@ (gjb)
2014-09-22 20:10:45 +00:00
emaste
5068586346 MFC r271762: Switch to text mode in UEFI boot
The loader previously failed to display on MacBooks and other
    systems where the UEFI firmware remained in graphics mode.

    Submitted by:       Rafael Espindola

Approved by:	re
2014-09-22 19:56:21 +00:00
davidcs
aba13028ac MFC r271726
remove clean option from Makefile

Approved by: re(gjb)
2014-09-22 19:00:30 +00:00
dumbbell
c0941fa5be vt(4): Merge several bug fixes and improvements
SVN revisions in this MFC:
  271756 271758 271868 271871 271872 271899

Detailed commit list:

r271756:
  vt(4): Fix out-of-bounds array access in VT_ACTIVATE ioctl handling

  CID:		1229964

r271758
  vt(4): Use strncpy() to copy into a fixed-size buffer

  CID:		1230007

r271868:
  vt(4): Remove vt_buf->vb_dirtymask

  This structure and the associated functions were unused since the
  implementation of vd_bitblt_text_t callbacks.

r271871:
  vt(4): Rewrite history scrolling

  It's now possible to scroll up the 500 hard-coded lines of history, not
  just a fraction of them. For instance, one can reach the top of the boot
  process.

  Sometimes, when scrolling or when changing the screen size (by changing
  the font or loading a KMS driver for instance), one could see the
  history cycling (old content appeared below latest lines). This is
  fixed.

  Now, when the resolution changes are more lines can be shown, the
  displayed area is adjusted so that, if the screen was filled with
  content before, it's filled with content after as well: more history
  is visible, instead of having blank lines below the previously visible
  content.

r271872:
  vt(4): Remove superfluous word in comment

  Submitted by:	brueffer@

r271899:
  Make gcc happy by initialising the variable only set in a couple of
  case statements without a default.

Approved by:	re (marius)
2014-09-22 16:13:33 +00:00
bz
1d7a8c573a MFC r271679:
Merge atse(4) interrupt handling and race condition fixes from
  cheribsd.

  Obtained from:	cheribsd
  Submitted by:		rwatson, emaste
Sponsored by:		DARPA/AFRL
Approved by:		re (delphij)
2014-09-22 15:32:31 +00:00
np
ed8e08d5db MFC r271450:
cxgbe(4): knobs to enable/disable PAUSE frame based flow control.

Approved by:	re (glebius)
2014-09-22 13:07:03 +00:00
ray
d214dc3b20 MFC 271381-271382,271385,271463-271466,271485,271506
o Add sysctls to enable/disable potentially dengerous key combinations, like
        reboot/halt/debug.
o Add support for most key combinations supported by syscons(4).
o Some spelling fixes
o Remove stray whitespaces.
o Switch vt(4) to traditional behaviour with copy-paste same as syscons(4) do.
o Fix stray char on paste.
o Fix 'function declaration isn't a prototype' warning.
o vt(4): Enclose vt_mouse_paste() prototype inside #ifndef SC_NO_CUTPASTE/#endif

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2014-09-22 10:21:08 +00:00
mav
88996dc68a MFC r271794: When updating device media size use cached cdevsw pointer.
Using pointer from the cdev directly is dangerous since we have no
reference on it, and it may change any time.  That caused panic if
device has gone.

While there, report capacity change only if it really changed.

Approved by:	re (dephij)
2014-09-21 12:07:22 +00:00
kib
0d20ed9aa7 MFC r271586:
Fix mis-spelling of bits and types names in the vnode_pager_putpages().

Approved by:	re (delphij)
2014-09-21 09:09:37 +00:00
kib
42e5d75eb4 MFC r271716:
Presence of any VM_PROT bits in the permission argument on x86 implies
that the entry is readable and valid.

Approved by:	re (gjb)
2014-09-20 14:24:48 +00:00
mav
b701075b7b MFC r271702:
Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL
UNIT DESCRIPTOR field as Identification Descriptor CSCD descriptor, not
just as Identification Descriptor.

Approved by:	re (gjb)
2014-09-20 13:48:52 +00:00
mav
9cd8f95281 MFC r271700: Fix typo in defined ROD types in r269497.
Approved by:	re (gjb)
2014-09-20 13:46:16 +00:00
hselasky
a3656a12d1 MFC r271492:
Workaround for receiving Voice Calls using the E1750 dongle from
Huawei. It might appear as if the firmware is allocating memory blocks
according to the USB transfer size and if there is initially a lot of
data, like at the answering machine prompt, it simply dies without any
apparent reason. The simple workaround for this is to force a zero
length packet at hardware level after every 512 bytes of data. This
will force the other side to use smaller memory blocks aswell.

Approved by:    re, gjb
2014-09-20 07:59:34 +00:00
emaste
b462b88810 MFC r271475 by ambrisko:
Add support for serial and null console to UEFI boot loader.

Approved by:	re
2014-09-19 21:30:45 +00:00
gjb
ae99ef305c Update stable/10 to -BETA2 as part of the 10.1-RELEASE
cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-09-19 00:03:25 +00:00
dumbbell
58c7b08e2c drm/i915: Add HW context support
This feature is required by Mesa 9.2+. Without this, a GL application
crashes with the following message:
    # glxinfo
    name of display: :0.0
    Gen6+ requires Kernel 3.6 or later.
    Assertion failed: (ctx->Version > 0), function handle_first_current,
      file ../../src/mesa/main/context.c, line 1498.
    Abort (core dumped)

Now, Mesa 10.2.4 and 10.3-rc3 works fine:
    # glxinfo
    name of display: :0
    display: :0  screen: 0
    direct rendering: Yes
    ...
    OpenGL renderer string: Mesa DRI Intel(R) 965GM
    OpenGL version string: 2.1 Mesa 10.2.4
    ...

The code was imported from Linux 3.8.13.

This an MFC of r271705.

Approved by:	re (glebius)
Reviewed by:	kib@
Tested by:	kwm@, danfe@, Henry Hu,
		Lundberg, Johannes <johannes@brilliantservice.co.jp>,
		Johannes Dieterich <dieterich.joh@gmail.com>,
		Lutz Bichler <lutz.bichler@gmail.com>,
Relnotes:	yes
2014-09-18 20:32:40 +00:00
grehan
98e396e70c MFC nmdm driver changes, r259550 and r271350
r259550 (glebius):
 Make nmdm(4) destroy devices when both sides of a pair are disconnected.
 This makes it possible to kldunload nmdm.ko when there are no users of it.

r271350:
 Fix issue with nmdm and leading zeros in device name.

 The nmdm code enforces a number between the 'nmdm' and 'A|B' portions
 of the device name. This is then used as a unit number, and sprintf'd
 back into the tty name. If leading zeros were used in the name,
 the created device name is different than the string used for the
 clone-open (e.g. /dev/nmdm0001A will result in /dev/nmdm1A).

 Since unit numbers are no longer required with the updated tty
 code, there seems to be no reason to force the string to be a
 number. The fix is to allow an arbitrary string between
 'nmdm' and 'A|B', within the constraints of devfs names. This allows
 all existing user of numeric strings to continue to work, and also
 allows more meaningful names to be used, such as bhyve VM names.

PR:	192281
Approved by:	re (glebius)
2014-09-18 19:20:08 +00:00
smh
a0b52baaa8 MFC r271429:
Persist vdev_resilver_txg changes to avoid panic caused by validation
vs a vdev_resilver_txg value from a previous resilver.

Approved by:	re (glebius)
Sponsored by:	Multiplay
2014-09-18 14:50:50 +00:00
grehan
45208196a6 MFC tty fixes, r259549 and r259663
Keep tty_makedev as a function to preserve the KBI on 10-stable
(it is a macro in CURRENT). The changes for this are direct
commits to 10-stable.

r259549 (glebius):
  - Rename tty_makedev() into tty_makedevf() and make it capable
    to fail and return error.
  - Use make_dev_p() in tty_makedevf() instead of make_dev_cred().
  - Always pass MAKEDEV_CHECKNAME flag.
  - Optionally pass MAKEDEV_REF flag.
  - Provide macro for compatibility with old API.

  This fixes races with simultaneous creation and desctruction of
  ttys, and makes it possible to call tty_makedevf() from device
  cloners.

  A race in tty_watermarks() still exist, since the latter drops
  lock for M_WAITOK allocation. This will be addressed in separate
  commit.

r259663 (glebius):
  Move list of ttys handling from the allocating procedures, to the
  device creation stage. A device creation can fail, and in that case
  an entry already on the list will be freed.

KBI issue pointed out by:       kib
Reviewed by:    kib (KBI addition)
Approved by:    re (kib)
2014-09-18 14:44:47 +00:00
dumbbell
4ed3581a36 vt(4): Merge several bug fixes and improvements
SVN revisions in this MFC:
  269779 270705 270706 271180 271250 271253 271682 271684

Detailed commit list:

r269779:
  fbd: Fix a bug where vt_fb_attach() success would be considered a failure

  vt_fb_attach() currently always returns 0, but it could return a code
  defined in errno.h. However, it doesn't return a CN_* code. So checking
  its return value against CN_DEAD (which is 0) is incorrect, and in this
  case, a success becomes a failure.

  The consequence was unimportant, because the caller (drm_fb_helper.c)
  would only log an error message in this case. The console would still
  work.

  Approved by:	nwhitehorn

r270705:
  vt(4): Add cngrab() and cnungrab() callbacks

  They are used when a panic occurs or when entering a DDB session for
  instance.

  cngrab() forces a vt-switch to the console window, no matter if the
  original window is another terminal or an X session. However, cnungrab()
  doesn't vt-switch back to the original window currently.

r270706:
  drm: Don't "taskqueue" vt-switch if under DDB/panic situation

  If DDB is active, we can't use a taskqueue thread to switch away from
  the X window, because this thread can't run.

  Reviewed by:	ray@
  Approved by:	ray@

r271180:
  vt_vga: vd_setpixel_t and vd_drawrect_t are noop in text mode

r271250:
  vt(4): Change the terminal and buffer sizes, even without a font

  This fixes a bug where scroll lock would not work for tty #0 when using
  vt_vga's textmode. The reason was that this window is created with a
  static 256x100 buffer, larger than the real size of 80x25.

  Now, in vt_change_font() and vt_compute_drawable_area(), we still
  perform operations even of the window has no font loaded (this is the
  case in textmode here vw->vw_font == NULL). One of these operation
  resizes the buffer accordingly.

  In vt_compute_drawable_area(), we take the terminal size as is (ie.
  80x25) for the drawable area.

  The font argument to vt_set_border() is removed (it was never used) and
  the code now uses the computed drawable area instead of re-doing its own
  calculation.

  Reported by:	Harald Schmalzbauer <h.schmalzbauer_omnilan.de>
  Tested by:	Harald Schmalzbauer <h.schmalzbauer_omnilan.de>

r271253:
  pause_sbt(): Take the cold path (ie. use DELAY()) if KDB is active

  This fixes a panic in the i915 driver when one uses debug.kdb.enter=1
  under vt(4).

  PR:		193269
  Reported by:	emaste@
  Submitted by:	avg@

r271682:
  vt(4): Fix a LOR which occurs during a call to vt_upgrade()

  Reported by:	kib@
  Review:		https://reviews.freebsd.org/D785
  Reviewed by:	ray@
  Approved by:	ray@

r271684:
  vt(4): Use vt_fb_drawrect() and vt_fb_setpixel() in all vt_fb-derivative

  Review:		https://reviews.freebsd.org/D789
  Reviewed by:	nwhitehorn
  Approved by:	nwhitehorn

Approved by:	re (gjb)
2014-09-18 14:38:18 +00:00
tuexen
a2c29a6744 MFC r271643:
Chunk IDs are 8 bit entities, not 16 bit.
Thanks to Peter Kasting from Google for drawing
my attention to it.

MFC r271665:
The MTU is handled as a 32-bit entity within the SCTP stack.
This was reported by Peter Kasting from Google.

MFC r271670:
Make a type conversion explicit. When compiling this code on
Windows as part of the SCTP userland stack, this fixes a
warning reported by Peter Kasting from Google.

MFC r271672:
Small cleanup which addresses a warning regaring the truncation
of a 64-bit entity to a 32-bit entity. This issue was reported by
Peter Kasting from Google.

MFC r271673:
Use a consistent type for the number of HMAC algorithms.
This fixes a bug which resulted in a warning on the userland
stack, when compiled on Windows.
Thanks to Peter Kasting from Google for reporting the issue and
provinding a potential fix.

MFC r271674:
Add a explict cast to silence a warning when building
the userland stack on Windows.
This issue was reported by Peter Kasting from Google.

Approved by: re (kib)
2014-09-18 09:49:49 +00:00
mav
30b741cb6c MFC r271644:
Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives.

Submitted by:	Sean Fagan <sef@ixsystems.com>
Approved by:	re (kib)
2014-09-18 09:21:29 +00:00
tuexen
1a3a68be7f MFC r270673:
Announce SCTP support in the kern.features sysctl variables.

MFC r270859:
Enable SCTP support. It runs perfectly fine on a Wandboard quad.

MFC r271204 with manual intervention:
Fix the handling of sysctl variables when used with VIMAGE.
While there do some cleanup of the code.

MFC r271209:
Fix a leak of an address, if the address is scheduled for removal
and the stack is torn down.
Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the
issue.

MFC r271219:
Use SYSCTL_PROC instead of SYSCTL_VNET_PROC.
Suggested by: glebius@

MFC r271221:
Use union sctp_sockstore instead of struct sockaddr_storage. This
eliminates some warnings when building in userland.
Thanks to Patrick Laimbock for reporting this issue.
Remove also some unnecessary casts.
There should be no functional change.

MFC r271228:
Address another warnings reported by Patrick Laimbock when compiling
in userspace. While there, improve consistency.

MFC r271230:
Address warnings generated by the clang analyzer.

Approved by: re (kib)
2014-09-18 08:58:22 +00:00
davidcs
badeddde87 MFC r268854
Initiate error recovery stats fail to update after 3 retries.
Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to
panic only if ECORE_STOP_ON_ERROR is defined.

Approved by: re(gjb)
2014-09-17 22:11:20 +00:00
jhb
297fe2e27a MFC 270830:
When anouncing link state changes on an 802.11 interface with a vap,
announce the change on the vap's ifnet instead of the main ifnet.  This
matches the behavior of other wireless drivers in the tree and allows the
default devd configuration to correctly start dhclient automatically after
an ndis wireless device associates.

Approved by:	re (marius for 10)
2014-09-17 18:17:18 +00:00
mav
7475a6ecf5 MFC r271403: Add PCI ID for Promise TX8660 8-port 3Gbps HBA.
This device reports RAID subclass, but appears to be AHCI compatible.

Submitted by:	Yuri Perejilin <yuri@rivera.ru>
Approved by:	re (gjb)
2014-09-17 14:17:39 +00:00
mav
0e425be7bb MFC r271604, r271616:
Add couple memory barriers to order tdq_cpu_idle and tdq_load accesses.

This change fixes transient performance drops in some of my benchmarks,
vanishing as soon as I am trying to collect any stats from the scheduler.
It looks like reordered access to those variables sometimes caused loss of
IPI_PREEMPT, that delayed thread execution until some later interrupt.

Approved by:	re (marius)
2014-09-17 14:06:21 +00:00
lstewart
25b8a28db6 MFC r270160:
Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload
panic easily triggered by running "sysctl -a" after unload.

Reported and tested by:	Grenville Armitage <garmitage@swin.edu.au>
Approved by:	re(gjb)
2014-09-16 21:26:24 +00:00
gjb
a289b49a0c Bump __FreeBSD_version after SA-14:19.tcp
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-09-16 19:20:06 +00:00
smh
a60923d309 MFC 265253:
Don't treat TRIM requests returning ENOTSUP as an unexpected error

Approved by:	re (gjb)
Sponsored by:	Multiplay
2014-09-16 17:47:13 +00:00
delphij
f7baec35a3 Fix Denial of Service in TCP packet processing.
Security:	FreeBSD-SA-14:19.tcp
Approved by:	re (implicit, security advisory)
2014-09-16 09:48:35 +00:00
grehan
4f02bb3b6b MFC r270689:
Implement the 0x2B SUB instruction, and the OR variant of 0x81.

    Found with local APIC accesses from bitrig/amd64 bsd.rd, 07/15-snap.

Approved by:	re (rodrigc)
2014-09-16 01:59:19 +00:00
emaste
37dd226a2e MFC EFI support for the installer
r264978 (nwhitehorn):

    Add EFI support to the installer. This requires that the kernel
    provide a sysctl to determine what firmware is in use. This sysctl
    does not exist yet, so the following blocks are in front of the
    wheels:
    - I've provisionally called this "hw.platform" after the equivalent
      thing on PPC
    - The logic to check the sysctl is short-circuited to always choose
      BIOS.  There's a comment in the top of the file about how to turn
      this off.

    If IA64 acquired a boot1.efifat-like thing (probably with very few
    modifications), the same code could be adapted there.

r265016 (nwhitehorn):

    Finish connecting up installer UEFI support. If the kernel was
    booted using EFI, set up the disks for an EFI system. If booted from
    BIOS/CSM, set up for BIOS.

r268256 (nwhitehorn):

    After EFI support was added to the installer, it needed to allow
    boot partitions of types other than "freebsd-boot" (in particular,
    "efi").  This allows the removal of some nasty hacks for supporting
    PowerPC systems, in particular aliasing freebsd-boot to apple-boot
    on APM and an IBM-specific code on MBR.

    This changes the installer to use the correct names, which also
    breaks a degeneracy in the meaning of "freebsd-boot" that allows the
    addition of support for some newer IBM systems that can boot from
    GPT in addition to MBR. Since I have no idea how to detect which
    those systems are, leave the default on IBM PPC systems as MBR for
    now.

Approved by:	re
PR:		193658
Relnotes:	Yes
2014-09-15 17:49:46 +00:00
trasz
333bfc8652 MFC r271317:
Avoid unlocking unlocked mutex in RCTL jail code.  Specific test case
is attached to PR.

PR:		193457
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2014-09-15 13:01:47 +00:00
brueffer
8f5f705c7e MFC: r271286
Use the right constants in comparisons.  This is currently a nop, as
MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD.

Reviewed by:    Eric Joyner @ Intel
Approved by:    re (kib)
2014-09-15 12:36:40 +00:00
trasz
7b29f9e4e1 MFC r271393:
Make it possible to disable NOP-In PDUs by the iSCSI initiator by setting
kern.cam.ctl.iscsi.ping_timeout to 0.  This fixes interoperability with
some initiators that don't properly support NOP-Ins, namely iPXE/gPXE.

Approved by:	re (kib)
2014-09-15 11:35:14 +00:00
royger
928f86ffd6 MFC r271099: revert r269814: blkfront: add support for unmapped IO
Current busdma code for unmapped bios will not properly align the
segment size, causing corruption on blkfront devices. Revert the commit
until busdma code is fixed.

Reported by:	mav
Approved by:	re
2014-09-15 08:58:17 +00:00
pfg
661c0752aa MFC r271149:
Apply known workarounds for less modern MacBooks.

The legacy USB circuit tends to give trouble on older MacBooks.
While the original report covered MacBook4, extend the fix
preemptively for the newer MacBookPro4 too.

PR:		191693
Reviewed by:	emaste
Approved by:	re
2014-09-13 18:27:47 +00:00
mav
9ea19c975a MFC r271407: Extend UNMAP blacklist on all STEC SSD models.
None of existing STEC devices need UNMAP or even support it well,
having many limitations and even hanging sometimes executing those
commands. New devices that may use UNMAP going to be released under
HGST name.

Approved by:	re (delphij)
2014-09-13 17:13:04 +00:00
mav
85a1618ec2 MFC r271362:
Make ctl_port_mask an array to support more then 32 ports.

Overflow reported by Coverity.

CID:		1229894

Approved by:	re (marius)
2014-09-13 17:08:27 +00:00