]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoMake 64-bit AIM trap handlers relocatable by changing all absolute branch
nwhitehorn [Wed, 21 Jan 2015 19:07:45 +0000 (19:07 +0000)]
Make 64-bit AIM trap handlers relocatable by changing all absolute branch
instructions to call through pointers instead. In general, these are set
implicitly through relocation processing. One has to be set explicitly in
machdep.c, however, to fit one handler in the tiny (8 instruction) space
available.

Reviewed by: andreast
Differential revision: D1554
Tested on: UP and SMP G5, Cell, POWER5+

9 years agoRemove addr2line from cross elftoolchain tools list
emaste [Wed, 21 Jan 2015 19:04:55 +0000 (19:04 +0000)]
Remove addr2line from cross elftoolchain tools list

It is not required, and there is no reason to install it just because it
came with the binutils cross tools.

Sponsored by: The FreeBSD Foundation

9 years agofiledesc: avoid spurious copying of capabilities in fget_unlocked
mjg [Wed, 21 Jan 2015 18:32:53 +0000 (18:32 +0000)]
filedesc: avoid spurious copying of capabilities in fget_unlocked

We obtain a stable copy and store it in local 'fde' variable. Storing another
copy (based on aforementioned variable) does not serve any purpose.

No functional changes.

9 years agofiledesc: return 0 from badfo_close
mjg [Wed, 21 Jan 2015 18:05:42 +0000 (18:05 +0000)]
filedesc: return 0 from badfo_close

The only potential in-tree consumer (_fdrop) special-cased it and returns 0
0 on its own instead of calling badfo_close.

Remove the special case since it is not needed and very unlikely to encounter
anyway.

No objections from: kib

9 years agofiledesc: fix whitespace nits in fget and fget_read
mjg [Wed, 21 Jan 2015 18:02:28 +0000 (18:02 +0000)]
filedesc: fix whitespace nits in fget and fget_read

No functional changes.

9 years agoAdd vfs.zfs.reference_tracking_enable sysctl/tunable.
will [Wed, 21 Jan 2015 17:03:11 +0000 (17:03 +0000)]
Add vfs.zfs.reference_tracking_enable sysctl/tunable.

This is primarily for developer/debugging use; it enables built-in tagged
tracking of refcounts inside ZFS.  It can only be enabled from the loader,
since it modifies how in-core state is managed.  Default remains disabled.

MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoUpdate the parsing of the cpu node. We are unable to use the reg property
andrew [Wed, 21 Jan 2015 16:52:24 +0000 (16:52 +0000)]
Update the parsing of the cpu node. We are unable to use the reg property
as the cpu id on arm64 as it may use two cells. In it's place we can use
the device id.

It is expected we will use the reg data on arm64 to enable cores so we
still need to read and store it even if it is not yet used.

Differential Revision: https://reviews.freebsd.org/D1555
Reviewed by: nwhitehorn
Sponsored by: The FreeBSD Foundation

9 years agoMerge all the copies of _tcb_ctor and _tcb_dtor.
andrew [Wed, 21 Jan 2015 16:41:05 +0000 (16:41 +0000)]
Merge all the copies of _tcb_ctor and _tcb_dtor.

The amd64, i386, and sparc64 versions were identical, with the one
difference where the former two used inline asm instead of _tcb_get. I
have compared the function before and after replacing the asm with _tcb_get
and found the object files to be identical.

The arm, mips, and powerpc versions were almost identical. The only
difference was the powerpc version used an alignment of 1 where arm and
mips used 16. As this is an increase in alignment is will be safe.

Along with this arm, mips, and powerpc all passed, when initial was true,
the value returned from _tcb_get as the first argument to
_rtld_allocate_tls. This would then return this pointer back to the caller.
We can remove these extra calls by checking if initial is set and setting
the thread control block directly. As this is what the sparc64 code does
we can use it directly.

As after these observations all the architectures can now have identical
code we can merge them into a common file.

Differential Revision: https://reviews.freebsd.org/D1556
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

9 years agoDo not assert that the new pipepair mutex is not initialized. The
kib [Wed, 21 Jan 2015 16:32:54 +0000 (16:32 +0000)]
Do not assert that the new pipepair mutex is not initialized.  The
backing memory contains garbage and might trigger the assertion.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoFix bug in r276630. Do not allow pthread_sigmask() to block SIGCANCEL.
kib [Wed, 21 Jan 2015 16:13:37 +0000 (16:13 +0000)]
Fix bug in r276630.  Do not allow pthread_sigmask() to block SIGCANCEL.

Reported and tested by: royger
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoAn update for the i915 GPU driver, which brings the code up to Linux
kib [Wed, 21 Jan 2015 16:10:37 +0000 (16:10 +0000)]
An update for the i915 GPU driver, which brings the code up to Linux
commit 4d93914ae3db4a897ead4b.  Some related drm infrastructure
changes are imported as needed.

Biggest update is the rewrite of the i915 gem io to more closely
follow Linux model, althought the mechanism used by FreeBSD port is
different.

Sponsored by: The FreeBSD Foundation
MFC after: 2 month

9 years ago"softc" is short for "software context", use that phrase in the
gavin [Wed, 21 Jan 2015 13:48:06 +0000 (13:48 +0000)]
"softc" is short for "software context", use that phrase in the
device_get_softc(9) man page.

MFC after: 1 week

9 years agoFix minor errors found by coverity. Thanks Gleb for
rrs [Wed, 21 Jan 2015 13:03:18 +0000 (13:03 +0000)]
Fix minor errors found by coverity. Thanks Gleb for
the pointers to the email!

9 years agoFollow up to r277449 by fixing the remaining NSEC_TO_TICK macro to have the same
ngie [Wed, 21 Jan 2015 10:47:28 +0000 (10:47 +0000)]
Follow up to r277449 by fixing the remaining NSEC_TO_TICK macro to have the same
named parameters

Reported by: Ben Perrault <ben.perrault@gmail.com>, Willem Jan Withagen <wjw@digiware.nl>

9 years agoTypo: ivalid -> invalid.
kevlo [Wed, 21 Jan 2015 09:01:48 +0000 (09:01 +0000)]
Typo: ivalid -> invalid.

9 years agoRemove a couple files that are no longer used (functionality take over by
ian [Wed, 21 Jan 2015 05:31:54 +0000 (05:31 +0000)]
Remove a couple files that are no longer used (functionality take over by
arm/bus_space_base.c).

9 years agoUse explicit initializer style, fill in missing functions as unimplemented.
ian [Wed, 21 Jan 2015 05:23:09 +0000 (05:23 +0000)]
Use explicit initializer style, fill in missing functions as unimplemented.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 05:10:23 +0000 (05:10 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 05:05:07 +0000 (05:05 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 04:28:19 +0000 (04:28 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 04:22:20 +0000 (04:22 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoRemove a no-longer-used include.
ian [Wed, 21 Jan 2015 04:19:54 +0000 (04:19 +0000)]
Remove a no-longer-used include.

9 years agoThe versatile platform had two copies of a bus_space that are essentially
ian [Wed, 21 Jan 2015 04:06:36 +0000 (04:06 +0000)]
The versatile platform had two copies of a bus_space that are essentially
duplicates of the standard arm base bus_space, so just use it.

9 years agoRename bus_space-v6.c to bus_space_base.c, because it's not v6-specific
ian [Wed, 21 Jan 2015 03:44:29 +0000 (03:44 +0000)]
Rename bus_space-v6.c to bus_space_base.c, because it's not v6-specific
and now some v5 Marvell systems are using it.  Only define fdt_bus_tag
if option FDT is defined.

9 years agoUse explicit initializer style, fill in missing functions.
ian [Wed, 21 Jan 2015 03:28:07 +0000 (03:28 +0000)]
Use explicit initializer style, fill in missing functions.

9 years agoMove bs_unimplemented() to bus_space_generic.c so it can be shared.
ian [Wed, 21 Jan 2015 03:24:18 +0000 (03:24 +0000)]
Move bs_unimplemented() to bus_space_generic.c so it can be shared.

9 years agoThe mv/bus_space.c file is essentially identical to arm/bus_space-v6.c,
ian [Wed, 21 Jan 2015 03:22:37 +0000 (03:22 +0000)]
The mv/bus_space.c file is essentially identical to arm/bus_space-v6.c,
so just use it.

9 years agoOn 64-bit PowerPC, use more native forms of the PPC 970 HID restore
nwhitehorn [Wed, 21 Jan 2015 02:57:54 +0000 (02:57 +0000)]
On 64-bit PowerPC, use more native forms of the PPC 970 HID restore
sequences, like are used to read the HIDs. This is both easier to read
and avoids a miscompilation by GCC in certain circumstances. Also avoid
double restoration of HID4 and HID5.

MFC after: 2 weeks

9 years agoFor some reason, all the arm bus_space functions that work with uint16
ian [Wed, 21 Jan 2015 02:56:13 +0000 (02:56 +0000)]
For some reason, all the arm bus_space functions that work with uint16
values have armv4 in the name.  There's nothing armv4-special about them,
so just use the same sort of names as all the other functions.

9 years agoUse arm/bus_space-v6.c for all armv6 systems, the essentially identical
ian [Wed, 21 Jan 2015 02:49:19 +0000 (02:49 +0000)]
Use arm/bus_space-v6.c for all armv6 systems, the essentially identical
files for lpc and xilinx aren't needed.  Also, fix a couple paste-os.

9 years agoUse the explicit member initializer style to init the bus_space struct.
ian [Wed, 21 Jan 2015 02:35:04 +0000 (02:35 +0000)]
Use the explicit member initializer style to init the bus_space struct.
Fill in some formerly NULL members where the implementation function
exists.  Add a dummy function that panics and use it as a placeholder
for thigns that are still unimplemented.  Remove a few unused includes.

9 years agoAdd missing R_X86_64_ constants to elf_common.h
emaste [Wed, 21 Jan 2015 01:12:21 +0000 (01:12 +0000)]
Add missing R_X86_64_ constants to elf_common.h

PR: 196918
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoFix xz handling for files larger than 32K.
delphij [Wed, 21 Jan 2015 01:11:37 +0000 (01:11 +0000)]
Fix xz handling for files larger than 32K.

Submitted by: Stefan Ehmann <shoesoft gmx net>
PR: bin/186861
MFC after: 2 weeks

9 years agoredelf: Add missing R_X86_64_ relocation types
emaste [Wed, 21 Jan 2015 01:07:58 +0000 (01:07 +0000)]
redelf: Add missing R_X86_64_ relocation types

PR: 196918
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1570

9 years agofiledesc: plug a test for impossible condition in _fget
mjg [Wed, 21 Jan 2015 01:06:14 +0000 (01:06 +0000)]
filedesc: plug a test for impossible condition in _fget

9 years agoRevise the arm bus_space implementation to avoid dereferencing the tag on
ian [Wed, 21 Jan 2015 01:06:08 +0000 (01:06 +0000)]
Revise the arm bus_space implementation to avoid dereferencing the tag on
every operation to retrieve the bs_cookie value almost nothing actually uses.

The bus_space struct contains a private data pointer (poorly named bs_cookie,
now renamed to bs_privdata) which is used only by a few old armv4 xscale
implementations.  The bus_space functions were all defined to take this
value as the first parameter instead of the bus_space_tag_t, requiring all
the inline macro and function expansions to dereference the tag to pass it
to another function, which never uses it.  Now all the functions take the tag
as the first parameter and retrieve the privdata if they need it.

Also fix a couple bus_space_unmap() implementations that were calling
kva_free() instead of pmap_unmapdev().

Discussed with:    cognet

9 years agoMerge the following revisions from ^/projects/release-vmimage:
gjb [Tue, 20 Jan 2015 23:56:04 +0000 (23:56 +0000)]
Merge the following revisions from ^/projects/release-vmimage:
 r273823-r273826, r273833, r273836, r273944, r274069-r274071,
 r274134, r274211, r274280-r274285, r274287-r274288, r274292,
 r274296-r274297, r274356, r274533, r274725, r274726, r274729,
 r274734, r274771, r274945-r274946, r277180, r277183-r277184,
 r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384,
 r277393-r277395, r277438-r277439, r277447, r277455:

 r273823:
  Move virtual machine / cloud provider targets and
  options from release/Makefile to their own Makefile.

 r273824:
  Add glue to allow enabling building cloud provider VM images
  by default.

  When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the
  release/Makefile 'release' target.

 r273825:
  Avoid hard-coding the Azure image file format.  While here,
  avoid using OSRELEASE for the output file name.

 r273826:
  Remove a few vestiges of passing an exit code to panic().

 r273833:
  Initial commit providing a mechanism to create openstack images
  as part of the release build.

 r273836:
  Fix output file name for openstack images.  No further conversion
  is necessary for this VM file target, so there is no need to append
  the '.raw' suffix here.

 r273944:
  Uncomment the cloudinit rc.conf(5) line.

 r274069:
  Add line continuation so OPENSTACKCONF is actually included in the env(1).

 r274070:
  Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS.

 r274071:
  Add examples for WITH_CLOUDWARE to release.conf.sample.
  Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.

 r274134:
  Initial rewrite to consolidate VM image build scripts into one.

 r274211:
  Add write_partition_layout() used to populate the final image.

  Fix duplicated mkimg(1) call in vm_create_disk().

  Add primitive (untested) PowerPC/PowerPC64 VM image support.

  Note: As it is currently written, the /boot/pmbr and
  /boot/{gptboot,boot1.hfs} use the build host and not the target
  build.  Fixing this is likely going to be a hack in itself.

 r274280:
  Return if vm_create_disk() is unsuccessful.

 r274281:
  Add CLEANFILES entry for VM targets

 r274282:
  Add vm_extra_pre_umount() prototype to vmimage.subr.

 r274283:
  Fix DESTDIR for installworld, and make sure it is created before use.

 r274284:
  Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr
  has not been sourced.

 r274285:
  Spell 'OPTARG' correctly.  Actually call vm_create_base().

 r274287:
  Fix line continuation in write_partition_layout().
  Remove variable test that is no longer needed.

 r274288:
  Fix scheme flag to mkimg(1).

 r274292:
  mount(8) and umount(8) devfs(5) as needed.

 r274296:
  Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
  it is consolidated into one file.

  Fix paths for the base image and output disk image files.

 r274297:
  Call cleanup() after everything is done.

 r274356:
  Remove a stray directory from CLEANFILES.

 r274533:
  Set the boot partition type to 'apple-boot' for powerpc.

 r274725:
  In vm_install_base(), copy the host resolv.conf into
  the build chroot before attempting to do anything that
  requires working DNS (i.e., pkg bootstrap).

  In vm_extra_pre_umount(), remove the resolv.conf before
  the disk image is unmounted from the backing md(4).

 r274726 (cperciva):
  Silence errors when umounting the chroot's /dev, since it
  probably doesn't exist when we're running this.

  Unmount filesystems before attempting to destroy the md which
  holds them.

 r274729 (cperciva):
  Unmount filesystem and destroy md before we read the vnode from
  disk and package it into a disk image.  Otherwise we end up
  packaging an unclean filesystem.

 r274734 (cperciva):
  Merge duplicative vm-CLOUDTYPE targets before additional duplication
  gets added by the impending arrival of ec2 and gcloud.

 r274771 (cperciva):
  Add NOSWAP option which can be set by a vmimage.conf file to specify
  that no swap space should be created in the image.  This will be used
  by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral"
  disks which are physically attached to the Xen host node.

 r274945:
  In vm_extra_install_packages(), only bootstrap pkg(8) if
  VM_EXTRA_PACKAGES is empty.

  In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
  bootstrapped earlier.

 r274946:
  Fix indentation nit.

 r277180:
  In vm_extra_install_base(), do not install waagent in the openstack
  image, because it is not used.  This appears to be a copy mistake.

  Remove vm_extra_install_base() from the openstack.conf entirely,
  since it does not need to be overridden.

 r277183:
  Enable the textmode console by default for VM images, since there is
  no way to tell if the environment will be able to use the
  graphics-mode console.

 r277184:
  Enable password-less sudo for openstack images.

 r277186:
  Update the VM_EXTRA_PACKAGES list for the openstack images.

  The documentation suggests doing a "just fetch this and run it"-style
  bootstrap, from which the list of dependencies was obtained (in
  github, at: pellaeon/bsd-cloudinit-installer)

  There is one Python dependency unmet, oslo.config, which is not in
  the Ports Collection.

 r277187:
  Add a comment to note that setting hw.vga.textmode=1 is temporary.

 r277250:
  Remove vm_extra_install_base() for the Azure image, now that the
  waagent exists in the ports tree.

  Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.

  In vm_extra_pre_umount(), remove the explicit pkg(8) install
  list, as dependencies are resolved by sysutils/azure-agent.

 r277251:
  Add a 'list-cloudware' target to print the list of supported CLOUDWARE
  values and a description.

  Add the AZURE_DESC and OPENSTACK_DESC descriptions.

 r277252:
  Update release(7)

 r277253:
  Add 'list-vmtargets' target, which produces a list of all supported
  VM and cloud provider images.

  Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.

  Format the output to make a bit more readable.

  Update release(7) to document the list-vmtargets target.

 r277263:
  Add initial support for the GCE (Google Compute Engine) cloud hosting
  provider image.

 r277264:
  Style and line length cleanup.

 r277383:
  Remove the console setting from rc.conf(5), which is not used there.
  While here, set console to include vidconsole in the loader.conf(5).

 r277384:
  Fix an indentation nit.
  No functional changes.

 r277393:
  Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
  function is often overridden.

  Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
  code.

 r277394:
  Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
  belongs.

  The GCE image needs resolv.conf(5) to exist (created as part of the
  image setup), so it cannot be removed.

 r277395:
  Comment the line that configures ttys(5) to 'off', which makes it
  impossible to test that the image boots.

  Add a note explaining why the line is commented, and not (yet) removed
  entirely.

 r277438:
  Move the 'install' bits that are specific to virtual machine images
  from the Makefile to Makefile.vm.

  Rename the 'install' target to 'release-install', and add a new
  'vm-install' target.

  Add a new 'install' target that invokes the new targets.

 r277439:
  Add WITH_CLOUDWARE to the list of make(1) variables for the release
  build.

 r277447:
  Remove hw.vga.textmode=1 from the VM image loader.conf, which was
  included during test builds and not intended to be included when
  merging this project branch back to head.

 r277455:
  Remove mk-azure.sh, which is no longer needed.

MFC after: 1 month
X-MFC-To: stable/10 (requires mkimg(1))
Help from: cperciva, swills
Relnotes: yes
Sponsored by: The FreeBSD Foundation

9 years agoAdd inline implementations of arm bus_space_read/write_N().
ian [Tue, 20 Jan 2015 22:56:59 +0000 (22:56 +0000)]
Add inline implementations of arm bus_space_read/write_N().

Reviewed by: cognet

9 years agoGarbage collect a prove test wrapper
ngie [Tue, 20 Jan 2015 22:51:29 +0000 (22:51 +0000)]
Garbage collect a prove test wrapper

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

9 years agoFix arc__shrink DTrace probe's to_free argument.
will [Tue, 20 Jan 2015 22:39:10 +0000 (22:39 +0000)]
Fix arc__shrink DTrace probe's to_free argument.

Remove the unnecessary #ifdef _KERNEL, which did not differ in the true or
false cases.  Actually set the value of to_free before using it.

MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoUse the "zfs_gfs" tag for GFS vnodes to make them easier to identify.
will [Tue, 20 Jan 2015 22:31:26 +0000 (22:31 +0000)]
Use the "zfs_gfs" tag for GFS vnodes to make them easier to identify.

MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoNSEC_TO_TICK(usec) -> NSEC_TO_TICK(nsec)
will [Tue, 20 Jan 2015 22:29:27 +0000 (22:29 +0000)]
NSEC_TO_TICK(usec) -> NSEC_TO_TICK(nsec)

9 years agoRemove unused strdup() #define.
will [Tue, 20 Jan 2015 22:27:45 +0000 (22:27 +0000)]
Remove unused strdup() #define.

9 years ago- Add jbeich as a ports committer
jbeich [Tue, 20 Jan 2015 21:49:50 +0000 (21:49 +0000)]
- Add jbeich as a ports committer
- List bapt and flo as his mentors

Differential Revision: https://reviews.freebsd.org/D1562
Approved by: flo (mentor)

9 years agoRestore the CAM XPT peripheral generation counter, and export it via sysctl.
will [Tue, 20 Jan 2015 21:15:33 +0000 (21:15 +0000)]
Restore the CAM XPT peripheral generation counter, and export it via sysctl.

Define it as an atomic uint32_t.  These increments happen infrequently
enough for the atomic overhead to be a problem, and since they're now
independent atomics, they won't contend with xpt_lock_buses().

This counter is useful as a means of cheaply identifying whether any changes
have been made to the CAM peripheral list.  Userland programs have no guarantee
that the counter won't change on them while being returned or while processing
the information, so they must be written accordingly.

Discussed with: ken, mav (in general)
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoMFV r277432:
delphij [Tue, 20 Jan 2015 20:36:36 +0000 (20:36 +0000)]
MFV r277432:

Plug various memory leaks in libzfs import implementation.

Illumos issue:
    5518 Memory leaks in libzfs import implementation

MFC after: 2 weeks

9 years agoRemove comparisons which are not necessary.
tuexen [Tue, 20 Jan 2015 19:08:55 +0000 (19:08 +0000)]
Remove comparisons which are not necessary.

Reported by: Coverity
CID: 123782612378441237847
MFC after: 1 week

9 years agoAllow clang to be built for mips/mips64 backend types by adding our mips
sbruno [Tue, 20 Jan 2015 17:00:28 +0000 (17:00 +0000)]
Allow clang to be built for mips/mips64 backend types by adding our mips
triple ids

This only allows testing and does not change the defaults for mips/mips64.
They still build/use gcc by default.

Differential Revision: https://reviews.freebsd.org/D1190
Reviewed by: dim

9 years agoo Restore 'goto tr_setup;' when operating in host mode mistakenly
br [Tue, 20 Jan 2015 16:30:02 +0000 (16:30 +0000)]
o Restore 'goto tr_setup;' when operating in host mode mistakenly
  removed in r277414.
o Remove extra parentheses around cases.

9 years agoThere does not seem to be any reason to acquire GIANT here. Follow amd64
nwhitehorn [Tue, 20 Jan 2015 16:21:59 +0000 (16:21 +0000)]
There does not seem to be any reason to acquire GIANT here. Follow amd64
in removing it.

MFC after: 1 month

9 years agoo Do notify USB host each time we receive 'set packet filter' request.
br [Tue, 20 Jan 2015 15:45:09 +0000 (15:45 +0000)]
o Do notify USB host each time we receive 'set packet filter' request.
  This makes Mac OS X happy when it returns back from suspending.
o Switch notify state after data is transferred, but not before.
o Consider there is also Super Speed mode.
o Do not set stall bit on any pipes in device mode as Mac OS X seems
  don't support it.

In collaboration with: hselasky@

9 years agoAllow skipping dmu_buf_will_dirty() call in dsl_dir_transfer_space().
mav [Tue, 20 Jan 2015 13:09:12 +0000 (13:09 +0000)]
Allow skipping dmu_buf_will_dirty() call in dsl_dir_transfer_space().

dsl_dir_transfer_space() is mostly called after dsl_dir_diduse_space(),
which already calls dmu_buf_will_dirty() for the same dbuf and tx, so
its duplicate call in those cases will change nothing, only spend time.

Skipping this call by four times reduces time spent in dbuf_write_done()
and descendants, updating dataset statistics with several congested lock
acquisitions.  When rewriting 8K zvol blocks at 1GB/s rate, this reduces
CPU time spent inside dbuf_write_done(), according to profiling, from 45%
of 683K samples to 18% of 422K.

MFC after: 2 weeks

9 years agoloader: fix the size of MODINFOMD_MODULEP
royger [Tue, 20 Jan 2015 12:28:24 +0000 (12:28 +0000)]
loader: fix the size of MODINFOMD_MODULEP

The data in MODINFOMD_MODULEP is packed by the loader as a 4 byte type, but
the amd64 kernel expects a vm_paddr_t, which is of size 8 bytes. Fix this by
saving it as 8 bytes in the loader and retrieving it using the proper type
in the kernel.

Sponsored by: Citrix Systems R&D

9 years agoFix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular
hselasky [Tue, 20 Jan 2015 11:43:16 +0000 (11:43 +0000)]
Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular
the value returned in the "udp_port_level" field.

Reported by: Uffe Jakobsen <uffe@uffe.org>
MFC after: 1 week

9 years agoRemove the SMP code from locore-v4. These will never use the SMP code as
andrew [Tue, 20 Jan 2015 11:32:48 +0000 (11:32 +0000)]
Remove the SMP code from locore-v4. These will never use the SMP code as
there is no multi-core hardware prior to ARMv6.

Sponsored by: The FreeBSD Foundation

9 years agoAdd the User and PL1 read only and reqd write thread ID registers.
andrew [Tue, 20 Jan 2015 11:11:32 +0000 (11:11 +0000)]
Add the User and PL1 read only and reqd write thread ID registers.

Sponsored by: The FreeBSD Foundation

9 years agoAdd 128-byte cache flushing routines.
br [Tue, 20 Jan 2015 11:10:25 +0000 (11:10 +0000)]
Add 128-byte cache flushing routines.

Leave CNMIPS untouched as these functions depends on config2
register.

9 years agoEnable Synopsys DesignWare Mobile Storage Host Controller
ganbold [Tue, 20 Jan 2015 09:07:28 +0000 (09:07 +0000)]
Enable Synopsys DesignWare Mobile Storage Host Controller
driver on Rockchip boards. It currently supports PIO mode
and dma mode needs external dma controller to be used.

Submitted by:   jmcneill
Approved by:    stas (mentor)

9 years agoRemove space in the FDT reservation map from the available memory regions
nwhitehorn [Tue, 20 Jan 2015 05:44:21 +0000 (05:44 +0000)]
Remove space in the FDT reservation map from the available memory regions
in ofw_mem_regions(). This function is actually MI and should move to
dev/ofw at some point in the near future so that ARM and MIPS can use the
same code.

9 years agoZero BSS explicitly if not started by loader(8). Add a check for the magic
nwhitehorn [Tue, 20 Jan 2015 05:28:03 +0000 (05:28 +0000)]
Zero BSS explicitly if not started by loader(8). Add a check for the magic
values that ePAPR-compliant loaders (like skiboot) put in the register
loader uses for the metadata pointer to avoid confusing them.

9 years agoUpdate the vdso timehands only via tc_windup().
neel [Tue, 20 Jan 2015 03:54:30 +0000 (03:54 +0000)]
Update the vdso timehands only via tc_windup().

Prior to this change CLOCK_MONOTONIC could go backwards when the timecounter
hardware was changed via 'sysctl kern.timecounter.hardware'. This happened
because the vdso timehands update was missing the special treatment in
tc_windup() when changing timecounters.

Reviewed by: kib

9 years agoProperly clear IRQ status in order to fix "Spurious IRQ" message from AINT.
gonzo [Tue, 20 Jan 2015 02:24:08 +0000 (02:24 +0000)]
Properly clear IRQ status in order to fix "Spurious IRQ" message from AINT.

This register is not documented in TRM but that's what linux driver does

9 years agoAdd missing linuxapi module dependencies and always use the FreeBSD
hselasky [Mon, 19 Jan 2015 21:53:00 +0000 (21:53 +0000)]
Add missing linuxapi module dependencies and always use the FreeBSD
"MODULE_VERSION" macro definition. Remove the redefinition of the
"MODULE_VERSION" macro from the Linux kernel compatibility API.

MFC after: 1 month
Reported by: np@
Sponsored by: Mellanox Technologies

9 years agoAdd more functions to the Linux kernel compatibility layer. Add some
hselasky [Mon, 19 Jan 2015 20:39:48 +0000 (20:39 +0000)]
Add more functions to the Linux kernel compatibility layer. Add some
missing includes which are needed when the header files are not
included in a particular order.

MFC after: 1 month
Sponsored by: Mellanox Technologies

9 years agoAdd some initial infrastructure for relocating the kernel in place.
nwhitehorn [Mon, 19 Jan 2015 17:58:01 +0000 (17:58 +0000)]
Add some initial infrastructure for relocating the kernel in place.

MFC after: 2 months
Differential revision: D1554

9 years agoStop enforcing additional reference on all cdevs, which was introduced
kib [Mon, 19 Jan 2015 17:36:52 +0000 (17:36 +0000)]
Stop enforcing additional reference on all cdevs, which was introduced
in r277199.  Acquire the neccessary reference in delist_dev_locked()
and inform destroy_devl() about it using CDP_UNREF_DTR flag.

Fix some style nits, add asserts.

Discussed with: hselasky
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoIgnore devfs directory entries for devices either being destroyed or
kib [Mon, 19 Jan 2015 17:24:52 +0000 (17:24 +0000)]
Ignore devfs directory entries for devices either being destroyed or
delisted.  The check is racy.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoRemove extra mtx_unlock().
mav [Mon, 19 Jan 2015 15:52:32 +0000 (15:52 +0000)]
Remove extra mtx_unlock().

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

9 years agoCode cleanup.
tuexen [Mon, 19 Jan 2015 11:52:08 +0000 (11:52 +0000)]
Code cleanup.

Reported by: Coverity
CID: 749578
MFC after: 1 week

9 years agoMake the clock-frequency property optional as it may not be present on FDT
andrew [Mon, 19 Jan 2015 11:06:56 +0000 (11:06 +0000)]
Make the clock-frequency property optional as it may not be present on FDT
systems.

Sponsored by: The FreeBSD Foundation

9 years agoMinor refactoring of code block.
hselasky [Mon, 19 Jan 2015 07:29:07 +0000 (07:29 +0000)]
Minor refactoring of code block.

MFC after: 1 day

9 years agoFix the build when INVARIANTS is defined by restoring `bo`'s definition in
ngie [Mon, 19 Jan 2015 07:10:08 +0000 (07:10 +0000)]
Fix the build when INVARIANTS is defined by restoring `bo`'s definition in
ext2_truncate(..) and by putting it under INVARIANTS ifdefs

X-MFC with: r277354
MFC after: 2 weeks

9 years agoMOVS instruction emulation.
neel [Mon, 19 Jan 2015 06:53:31 +0000 (06:53 +0000)]
MOVS instruction emulation.

These instructions are emitted by 'bus_space_read_region()' when accessing
MMIO regions.

Since MOVS can be used with a repeat prefix start decoding the REPZ and
REPNZ prefixes. Also start decoding the segment override prefix since MOVS
allows overriding the source operand segment register.

Tested by: tychon
MFC after: 1 week

9 years agoFix a bug in libvmmapi 'vm_copy_setup()' where it would return success even if
neel [Mon, 19 Jan 2015 06:51:04 +0000 (06:51 +0000)]
Fix a bug in libvmmapi 'vm_copy_setup()' where it would return success even if
the 'gpa' was in the guest MMIO region. This would manifest as a segmentation
fault in 'vm_map_copyin()' or 'vm_map_copyout()' because 'vm_map_gpa()' would
return NULL for this 'gpa'.

Fix this by calling 'vm_map_gpa()' in 'vm_copy_setup' and returning a failure
if the 'gpa' cannot be mapped. This matches the behavior of 'vm_copy_setup()'
in vmm.ko.

MFC after: 1 week

9 years agoIntegrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/tests
ngie [Mon, 19 Jan 2015 06:13:07 +0000 (06:13 +0000)]
Integrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/tests

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoExpect :overflow to fail with FreeBSD's expr as it doesn't have stringent
ngie [Mon, 19 Jan 2015 06:10:01 +0000 (06:10 +0000)]
Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
overflow checks like NetBSD's expr does

MFC after: 3 days
PR: 196867

9 years agoProvide a tunable (machdep.moea64_bpvo_pool_size) to set the bootstrap
nwhitehorn [Mon, 19 Jan 2015 05:14:07 +0000 (05:14 +0000)]
Provide a tunable (machdep.moea64_bpvo_pool_size) to set the bootstrap
PVO pool size. The default errs on the exceedingly large side, so absent
any intelligent automatic tuning, at least let the user set it to save
RAM on memory-constrained systems.

MFC after: 2 weeks

9 years agoFor armv6 builds, add -mfloat-abi=softfp. This tells the compiler it can
ian [Mon, 19 Jan 2015 04:56:17 +0000 (04:56 +0000)]
For armv6 builds, add -mfloat-abi=softfp.  This tells the compiler it can
use floating point hardware instructions (because all armv6/7 systems we
support have fp hardware), but it passes args using a soft-float compatible
ABI.  This should give noticible performance improvement (but not as much
as using the armv6hf arch).

9 years agoext2: Garbage-collect some unused variables
pfg [Mon, 19 Jan 2015 03:30:45 +0000 (03:30 +0000)]
ext2: Garbage-collect some unused variables

Reported by: clang static analysis
MFC after: 2 weeks

9 years agoUpgrade libxo to 0.2.0.
marcel [Mon, 19 Jan 2015 02:22:03 +0000 (02:22 +0000)]
Upgrade libxo to 0.2.0.

Obtained from: https://github.com/Juniper/libxo
Requested by: Phil Shafer <phil@juniper.net>

Revisions 276253 & 276273 were incorporated into 0.2.0.
Revision 276260 has been merged-in.

9 years agoWhen mountd is creating sockets, it iterates over all addresses specified
rstone [Mon, 19 Jan 2015 00:33:32 +0000 (00:33 +0000)]
When mountd is creating sockets, it iterates over all addresses specified
in the "hosts" array and eventually looks up the network address with
getaddrinfo(). At one point it checks for a numeric address and if it
sees one, it sets a hint parameter to force getaddrinfo to interpret the
host as a numeric address. However that hint is not cleared for subsequent
iterations of the loop and if any hosts seen after this point are host names,
getaddrinfo will fail on the name.  The result of this bug is that you cannot
pass a host name to the -h flag.

Unfortunately, the first iteration will either process ::1 or 127.0.0.1,
so the flag is set on the first iteration and all host names will fail
to be processed.

The same bug applies to rpc.lockd and rpc.statd, so fix them too.

Differential Revision: https://reviews.freebsd.org/D1507
Reported by: Dylan Martin
MFC after: 1 week
Sponsored by: Sandvine Inc.

9 years agoClean ZFS spa config before syncing
smh [Sun, 18 Jan 2015 23:15:49 +0000 (23:15 +0000)]
Clean ZFS spa config before syncing

A number of entries that can be present in the spa config shouldn't be saved
to disk so add a method to ensure this is case. Without this if the last
caller to vdev_config_generate requested stats then we can end up in the
cache file.

Also only skip a none writable pool in the cache file generation if its
active. This prevents unavailable pools incorrectly getting removed from
cache file.

Tested by: delphij
MFC after: 2 weeks
Sponsored by: Multiplay

9 years agoFix a bug which only shows up when an mbuf allocation failed.
tuexen [Sun, 18 Jan 2015 22:00:39 +0000 (22:00 +0000)]
Fix a bug which only shows up when an mbuf allocation failed.
Therefore chances are low that we hit this.

Reported by: Coverity
CID: 1018886
MFC after: 1 week

9 years agoext2: fix for uninitialized pointer read.
pfg [Sun, 18 Jan 2015 21:18:28 +0000 (21:18 +0000)]
ext2: fix for uninitialized pointer read.

path.ep_bp was being used uninitialized in ext4_ext_find_extent().

CID: 1062344
MFC after: 1 week

9 years agoRemove an unnecessary check.
tuexen [Sun, 18 Jan 2015 21:16:22 +0000 (21:16 +0000)]
Remove an unnecessary check.

Reported by: Coverity
CID: 749576
MFC after: 1 week

9 years agoAdd protection code to free memory in case of processing an address which
tuexen [Sun, 18 Jan 2015 20:53:20 +0000 (20:53 +0000)]
Add protection code to free memory in case of processing an address which
is neither IPv4 or IPv6.

Reported by: Coverity
CID: 749311
MFC after: 1 week

9 years agoSave the command-and-flags value into the shadow register when it is written.
ian [Sun, 18 Jan 2015 20:47:21 +0000 (20:47 +0000)]
Save the command-and-flags value into the shadow register when it is written.

This doesn't actually change any behavior, because it just allows a 16-bit
read of the command register to return the correct value, and nothing
actually does a 16-bit read of that register.

9 years agoRemove dead code.
pfg [Sun, 18 Jan 2015 20:26:27 +0000 (20:26 +0000)]
Remove dead code.

After the ext2 variant of the "orlov allocator" was implemented,
the case for a negative or zero dirsize disappeared.

Drop the dead code and unsign dirsize given that it can't be
negative anyways.

CID: 1008669
MFC after: 1 week

9 years agoRemove an unused variable.
tuexen [Sun, 18 Jan 2015 20:20:27 +0000 (20:20 +0000)]
Remove an unused variable.

Reported by: Coverity
CID: 750999
MFC after: 1 week

9 years agoUse TOC to look up all kernel globals on powerpc64 instead of doing the
nwhitehorn [Sun, 18 Jan 2015 20:00:33 +0000 (20:00 +0000)]
Use TOC to look up all kernel globals on powerpc64 instead of doing the
non-relocatable lis @ha, ori @l dance and hoping they are below 4 GB.

MFC after: 2 months

9 years agoRefactor PowerPC (especially AIM) init sequence to be less baroque.
nwhitehorn [Sun, 18 Jan 2015 18:32:43 +0000 (18:32 +0000)]
Refactor PowerPC (especially AIM) init sequence to be less baroque.

MFC after: 2 months

9 years agoFix bsdinstall when working with geli boot disks
smh [Sun, 18 Jan 2015 18:25:12 +0000 (18:25 +0000)]
Fix bsdinstall when working with geli boot disks

PR: 196790
Differential Revision: https://reviews.freebsd.org/D566
Submitted by: Michael Gmelin <grembo@FreeBSD.org>
MFC after: 2 weeks
Sponsored by: Multiplay

9 years agoRefactor / restructure the RSS code into generic, IPv4 and IPv6 specific
adrian [Sun, 18 Jan 2015 18:06:40 +0000 (18:06 +0000)]
Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific
bits.

The motivation here is to eventually teach netisr and potentially
other networking subsystems a bit more about how RSS work queues / buckets
are configured so things have a hope of auto-configuring in the future.

* net/rss_config.[ch] takes care of the generic bits for doing
  configuration, hash function selection, etc;
* topelitz.[ch] is now in net/ rather than netinet/;
* (and would be in libkern if it didn't directly include RSS_KEYSIZE;
  that's a later thing to fix up.)
* netinet/in_rss.[ch] now just contains the IPv4 specific methods;
* and netinet/in6_rss.[ch] now just contains the IPv6 specific methods.

This should have no functional impact on anyone currently using
the RSS support.

Differential Revision: D1383
Reviewed by: gnn, jfv (intel driver bits)

9 years agoOops - use the correct argument order for ar9300_set_beacon().
adrian [Sun, 18 Jan 2015 17:43:00 +0000 (17:43 +0000)]
Oops - use the correct argument order for ar9300_set_beacon().

(It's only an issue in AP/adhoc modes. But, still. Grr.)

9 years agoFix minor syntax and grammar errors in the markup of the ee(1) man page
allanjude [Sun, 18 Jan 2015 17:25:41 +0000 (17:25 +0000)]
Fix minor syntax and grammar errors in the markup of the ee(1) man page

Differential Revision: https://reviews.freebsd.org/D1552
Submitted by: bcallah@openbsd.org (original)
Approved by: wblock (mentor)
MFC after: 1 week
Sponsored by: ScaleEngine Inc.

9 years agoAdd procctl(2) PROC_TRACE_CTL command to enable or disable debugger
kib [Sun, 18 Jan 2015 15:13:11 +0000 (15:13 +0000)]
Add procctl(2) PROC_TRACE_CTL command to enable or disable debugger
attachment to the process.  Note that the command is not intended to
be a security measure, rather it is an obfuscation feature,
implemented for parity with other operating systems.

Discussed with: jilles, rwatson
Man page fixes by: rwatson
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoMake SIGSTOP working for sleeps done while waiting for fifo readers or
kib [Sun, 18 Jan 2015 15:03:26 +0000 (15:03 +0000)]
Make SIGSTOP working for sleeps done while waiting for fifo readers or
writers in open(2), when the fifo is located on an NFS mount.

Reported by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoUpgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix
dim [Sun, 18 Jan 2015 14:14:47 +0000 (14:14 +0000)]
Upgrade our copy of clang and llvm to 3.5.1 release.  This is a bugfix
only release, no new features have been added.

Please note that this version requires C++11 support to build; see
UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.5.1/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.1/tools/clang/docs/ReleaseNotes.html>

MFC after: 1 month
X-MFC-With: 276479

9 years agoMake the linuxapi module only build when WITH_OFED=YES is specified.
hselasky [Sun, 18 Jan 2015 14:04:55 +0000 (14:04 +0000)]
Make the linuxapi module only build when WITH_OFED=YES is specified.
There needs to be some more testing done before it is ready for all
platforms and architectures.

MFC after: 1 month
Sponsored by: Mellanox Technologies
Reported by: bz@

9 years agoWhen disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't
cperciva [Sun, 18 Jan 2015 12:45:26 +0000 (12:45 +0000)]
When disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't
accidentally enable non-existent states.

This bug was triggered if ACPI advertises the presence of a C2 state
which we fail to parse via acpi_PkgGas due to our lack of support for
FFixedHW resources, and causes an immediate panic when an attempt is
made to enter the (NULL) state.

One affected platform is the EC2 c4.8xlarge VM instance type; there
may be others.

MFC after: 1 week
Thanks to: jkim, @_msw_