]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoFix Clang warning: passing 'unsigned int *' to parameter of type 'int *' converts...
dchagin [Thu, 1 Jan 2015 19:57:24 +0000 (19:57 +0000)]
Fix Clang warning: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign.

MFC after: 1 week

9 years agoRegen after r276508, r276509.
dchagin [Thu, 1 Jan 2015 18:43:31 +0000 (18:43 +0000)]
Regen after r276508, r276509.

9 years agoCorrect an argument status of wait4 syscall for Linuxulator.
dchagin [Thu, 1 Jan 2015 18:41:34 +0000 (18:41 +0000)]
Correct an argument status of wait4 syscall for Linuxulator.
Forgot about i386.

MFC after: 1 week

9 years agoCorrect an argument status of wait4 syscall for Linuxulator.
dchagin [Thu, 1 Jan 2015 18:37:03 +0000 (18:37 +0000)]
Correct an argument status of wait4 syscall for Linuxulator.

MFC after: 1 week

9 years agoRemove the clang -no-integrated-as workaround for smapi_bios.S, as clang
dim [Thu, 1 Jan 2015 16:56:15 +0000 (16:56 +0000)]
Remove the clang -no-integrated-as workaround for smapi_bios.S, as clang
3.5.0 now supports the assembly just fine.

9 years agoLLVM integrated assembler can assemble these files just fine.
rdivacky [Thu, 1 Jan 2015 10:07:57 +0000 (10:07 +0000)]
LLVM integrated assembler can assemble these files just fine.

9 years agocxgbe(4): remove buf_ring specific restriction on the txq size.
np [Thu, 1 Jan 2015 09:33:46 +0000 (09:33 +0000)]
cxgbe(4): remove buf_ring specific restriction on the txq size.

MFC after: 2 months

9 years agoPut the conditional back. For the default case it isn't really needed,
imp [Thu, 1 Jan 2015 08:30:32 +0000 (08:30 +0000)]
Put the conditional back. For the default case it isn't really needed,
but for the gcc case it still is on i386 and amd64's build of
sys/boot.

Submited by: dim@

9 years agoMove more of the warnings into kern.mk, as well as centralize that as
imp [Thu, 1 Jan 2015 08:18:08 +0000 (08:18 +0000)]
Move more of the warnings into kern.mk, as well as centralize that as
the place where the C dialect is selected. Have a fairly long list
of newly requires warning suppression for clang 3.5.0, also
centralized in kern.mk. Survive the fallout of the removal of
bsd.sys.mk from bsd.kmod.mk.

9 years agoFix markup for minthreads and maxthreads.
delphij [Thu, 1 Jan 2015 06:53:33 +0000 (06:53 +0000)]
Fix markup for minthreads and maxthreads.

PR: 196403
MFC after: 2 weeks

9 years agoEliminate bsd.sys.mk on purpose. Do not put it back.
imp [Thu, 1 Jan 2015 04:26:45 +0000 (04:26 +0000)]
Eliminate bsd.sys.mk on purpose. Do not put it back.

9 years agoUnbreak the build for some modules that depend on -std flags to be passed
ngie [Thu, 1 Jan 2015 04:10:56 +0000 (04:10 +0000)]
Unbreak the build for some modules that depend on -std flags to be passed
through via CFLAGS, as noted by Jenkins when building sparc64 by re-adding
bsd.sys.mk to bsd.kmod.mk:
https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64/225/changes

Tested with:
    % cd /sys/modules/bce; make obj; make depend; make all

9 years agoAdd softc flag for when the indirect descriptor feature was negotiated
bryanv [Thu, 1 Jan 2015 02:06:00 +0000 (02:06 +0000)]
Add softc flag for when the indirect descriptor feature was negotiated

MFC after: 2 weeks

9 years agoUse the appropriate IPv4 or IPv6 TSO HW assist flag
bryanv [Thu, 1 Jan 2015 02:03:09 +0000 (02:03 +0000)]
Use the appropriate IPv4 or IPv6 TSO HW assist flag

MFC after: 2 weeks

9 years agoFix module builds on arm (and maybe others) by turning off a whole
imp [Thu, 1 Jan 2015 02:00:04 +0000 (02:00 +0000)]
Fix module builds on arm (and maybe others) by turning off a whole
raft of new warnings that appear to be on by default in clang 3.5.0.
Fix RPI-B build issues with new clang not liking the ability to pass
arbitrary flags to as, since some flags are more arbitrary (and thus
verboten) than others.

These warnings should be actually fixed in the code, but this is a
band-aide to get things (almost) building again.

9 years agocxgbe(4): major tx rework.
np [Wed, 31 Dec 2014 23:19:16 +0000 (23:19 +0000)]
cxgbe(4): major tx rework.

a) Front load as much work as possible in if_transmit, before any driver
lock or software queue has to get involved.

b) Replace buf_ring with a brand new mp_ring (multiproducer ring).  This
is specifically for the tx multiqueue model where one of the if_transmit
producer threads becomes the consumer and other producers carry on as
usual.  mp_ring is implemented as standalone code and it should be
possible to use it in any driver with tx multiqueue.  It also has:
- the ability to enqueue/dequeue multiple items.  This might become
  significant if packet batching is ever implemented.
- an abdication mechanism to allow a thread to give up writing tx
  descriptors and have another if_transmit thread take over.  A thread
  that's writing tx descriptors can end up doing so for an unbounded
  time period if a) there are other if_transmit threads continuously
  feeding the sofware queue, and b) the chip keeps up with whatever the
  thread is throwing at it.
- accurate statistics about interesting events even when the stats come
  at the expense of additional branches/conditional code.

The NIC txq lock is uncontested on the fast path at this point.  I've
left it there for synchronization with the control events (interface
up/down, modload/unload).

c) Add support for "type 1" coalescing work request in the normal NIC tx
path.  This work request is optimized for frames with a single item in
the DMA gather list.  These are very common when forwarding packets.
Note that netmap tx in cxgbe already uses these "type 1" work requests.

d) Do not request automatic cidx updates every 32 descriptors.  Instead,
request updates via bits in individual work requests (still every 32
descriptors approximately).  Also, request an automatic final update
when the queue idles after activity.  This means NIC tx reclaim is still
performed lazily but it will catch up quickly as soon as the queue
idles.  This seems to be the best middle ground and I'll probably do
something similar for netmap tx as well.

e) Implement a faster tx path for WRQs (used by TOE tx and control
queues, _not_ by the normal NIC tx).  Allow work requests to be written
directly to the hardware descriptor ring if room is available.  I will
convert t4_tom and iw_cxgbe modules to this faster style gradually.

MFC after: 2 months

9 years agoMigrate the RSS IPv6 hash code to use pointers to the v6 addresses
adrian [Wed, 31 Dec 2014 22:52:43 +0000 (22:52 +0000)]
Migrate the RSS IPv6 hash code to use pointers to the v6 addresses
rather than passing them in by value.

The eventual aim is to do incremental hash construction rather than
all of the memcpy()'ing into a contiguous buffer for the hash
function, which does show up as taking quite a bit of CPU during
profiling.

Tested:

* a variety of laptops/desktop setups I have, with v6 connectivity

Differential Revision: D1404
Reviewed by: bz, rpaulo

9 years agoThe variable used with install(1) for stripping should be STRIPBIN, not
ngie [Wed, 31 Dec 2014 22:49:02 +0000 (22:49 +0000)]
The variable used with install(1) for stripping should be STRIPBIN, not
STRIP_CMD

MFC after: 3 days
Reported by: lev

9 years agoFree the buffer returned by gpio_pin_list() after the use.
loos [Wed, 31 Dec 2014 21:58:03 +0000 (21:58 +0000)]
Free the buffer returned by gpio_pin_list() after the use.

Reported by: Coverity Scan
CID: 1257468

9 years agoTemporarily unplug cxgbe(4) from !amd64 builds.
np [Wed, 31 Dec 2014 20:34:12 +0000 (20:34 +0000)]
Temporarily unplug cxgbe(4) from !amd64 builds.

9 years agoUpgrade our copy of clang, llvm and lldb to 3.5.0 release.
dim [Wed, 31 Dec 2014 20:31:32 +0000 (20:31 +0000)]
Upgrade our copy of clang, llvm and lldb to 3.5.0 release.

Please note that this version now 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.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste, Roman Divacky, Andrew Turner, Justin Hibbits and
Antoine Brodin for their invaluable help with this import.

Approved by: portmgr (antoine)
MFC after: 1 month

9 years agoreadelf: Add stdint.h for C99 fixed size types
emaste [Wed, 31 Dec 2014 19:21:53 +0000 (19:21 +0000)]
readelf: Add stdint.h for C99 fixed size types

Upstream elftoolchain brings in stdint.h via an ELF header that we
do not use in FreeBSD.

Sponsored by: The FreeBSD Foundation

9 years agoMerge ^/head r274961 through r276475.
dim [Wed, 31 Dec 2014 18:16:50 +0000 (18:16 +0000)]
Merge ^/head r274961 through r276475.

9 years agoSome minor changes to UPDATING.
dim [Wed, 31 Dec 2014 18:11:09 +0000 (18:11 +0000)]
Some minor changes to UPDATING.

9 years agoEliminate a stale debug message. The per-CPU cache locks were replaced
alc [Wed, 31 Dec 2014 17:44:57 +0000 (17:44 +0000)]
Eliminate a stale debug message.  The per-CPU cache locks were replaced
by critical sections in r145686.

PR: 193254
Submitted by: luke.tw@gmail.com
MFC after: 3 days

9 years agoMerge ^/head r274961 through r276472.
dim [Wed, 31 Dec 2014 16:50:46 +0000 (16:50 +0000)]
Merge ^/head r274961 through r276472.

9 years agoFixes to exit status.
pfg [Wed, 31 Dec 2014 16:30:33 +0000 (16:30 +0000)]
Fixes to exit status.

Exit with EXIT_FAILURE for invalid arguments.
Fixes NetBSD-PR 43517.

Print version string to stdout instead of stderr;
it is user-requested and not an error.

Obtained from: NetBSD
MFC after: 5 days

9 years agoA couple small fixes to make clang 3.5 happy... Move END(sigcode) to the
ian [Wed, 31 Dec 2014 16:15:43 +0000 (16:15 +0000)]
A couple small fixes to make clang 3.5 happy... Move END(sigcode) to the
end of the actual instruction sequence for the function but before some
misc data in the text segment.  This eliminates a strange "size must be
constant" error from the integrated assembler.  Also, the build_pagetables
function was missing an END(), but really the problem is that it shouldn't
have an ASENTRY() because it's not a function that needs to be a global
symbol with unwind info and all, it's just a little private subroutine
used in very early kernel init.

9 years ago- Switching the mode of Ricoh R5CE823 to SD2.0 causes their PCI device ID
marius [Wed, 31 Dec 2014 16:06:26 +0000 (16:06 +0000)]
- Switching the mode of Ricoh R5CE823 to SD2.0 causes their PCI device ID
  to change to 0xe822, which may be persistent across reboots and, thus,
  confuse other OSes. Therefore, restore the original mode and frequency
  setting on detach and shutdown.
- Report Ricoh R5CE822 as such.
- According to Linux, Ricoh R5CE822 also need SDHCI_QUIRK_LOWER_FREQUENCY.
- Nuke an unused softc member.

MFC after: 3 days

9 years agoBump copyright year.
bz [Wed, 31 Dec 2014 10:00:43 +0000 (10:00 +0000)]
Bump copyright year.

Happy New Year 2015!

9 years agoCorrect zpool list displaying invalid EXPANDSZ for unavailable pool vdevs
smh [Wed, 31 Dec 2014 04:54:48 +0000 (04:54 +0000)]
Correct zpool list displaying invalid EXPANDSZ for unavailable pool vdevs

When pools are unavailable their vdevs are also unavailable which means
that vdev_max_asize remains at the default zero. This default was being
used to calculate vs_esize resulting in a negative number as vdev_asize >
vdev_max_asize, which caused zpool list -v to display 16.0E for EXPANDSZ
of these vdevs.

9 years agoUse the correct state name for unavailable pools in zpool list
smh [Wed, 31 Dec 2014 04:11:29 +0000 (04:11 +0000)]
Use the correct state name for unavailable pools in zpool list

This corrects inconsitencies between zpool list and zpool status which are
both described as displaying the pool <state> however zpool list would use
this hardcoded FAULTED instead of the correct UNAVAIL.

MFC after: 1 month

9 years agoChange the order of operations for the initial cache setup. Turning off
ian [Wed, 31 Dec 2014 02:38:23 +0000 (02:38 +0000)]
Change the order of operations for the initial cache setup.  Turning off
the cache before clean/invalidate ensured that no new lines can come into
the cache or migrate between levels during the operation, but may not be
safe on some chips.  Instead, if the cache was enabled on entry, do the
wbinv while it's still enabled, and then disable it and do a separate
invalidate pass.  After the intitial writeback we know there are no
dirty lines left and no new dirty lines can be created as long as we
carefully avoid touching memory before turning the cache off.  Add a
comment about that so no new code gets inserted between those points.

9 years agoFix a paste-o.
ian [Wed, 31 Dec 2014 02:33:12 +0000 (02:33 +0000)]
Fix a paste-o.

Submitted by: Michal Meloun <meloun@miracle.cz>

9 years agolibelf: Rearrange size test to prevent integer overflow
emaste [Wed, 31 Dec 2014 01:48:23 +0000 (01:48 +0000)]
libelf: Rearrange size test to prevent integer overflow

Sponsored by: The FreeBSD Foundation

9 years agoThe physical memory allocator supports the use of distinct free lists for
alc [Wed, 31 Dec 2014 00:54:38 +0000 (00:54 +0000)]
The physical memory allocator supports the use of distinct free lists for
managing pages from different address ranges.  Generally speaking, this
feature is used to increase the likelihood that physical pages are
available that can meet special DMA requirements or can be accessed through
a limited-coverage direct mapping (e.g., MIPS).  However, prior to this
change, the configuration of the free lists was static, i.e., it was
determined at compile time.  Consequentally, free lists could be created
for address ranges that held no actual pages, for example, on 32-bit MIPS-
based systems with 512 MB or less of physical memory.  This change makes
the creation of the free lists dynamic, i.e., it is based on the available
physical memory at boot time.

On 64-bit x86-based systems with 64 GB or more of physical memory, create
free lists for managing pages with physical addresses below 4 GB.  This
change is to address reported problems with initializing devices that
require the allocation of physical pages below 4 GB on some systems with
128 GB or more of physical memory.

PR: 185727
Differential Revision: https://reviews.freebsd.org/D1274
Reviewed by: jhb, kib
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

9 years agoInitialize all fields of 'struct vm_exception exception' before passing it to
neel [Tue, 30 Dec 2014 23:38:31 +0000 (23:38 +0000)]
Initialize all fields of 'struct vm_exception exception' before passing it to
vm_inject_exception(). This fixes the issue that 'exception.cpuid' is
uninitialized when calling 'vm_inject_exception()'.

However, in practice this change is a no-op because vm_inject_exception()
does not use 'exception.cpuid' for anything.

Reported by:    Coverity Scan
CID:            1261297
MFC after:      3 days

9 years agoFirst stab at UPDATING notes for clang 3.5.0.
dim [Tue, 30 Dec 2014 22:46:20 +0000 (22:46 +0000)]
First stab at UPDATING notes for clang 3.5.0.

9 years agoExpect access_test:access_inval to fail before __FreeBSD_version == 1100033
ngie [Tue, 30 Dec 2014 22:32:29 +0000 (22:32 +0000)]
Expect access_test:access_inval to fail before __FreeBSD_version == 1100033

This will allow me to MFC the test, as jilles@ requested that I don't MFC the
access(2) KBI change to 10-STABLE in r271655

9 years agoReplace bhyve's minimal RTC emulation with a fully featured one in vmm.ko.
neel [Tue, 30 Dec 2014 22:19:34 +0000 (22:19 +0000)]
Replace bhyve's minimal RTC emulation with a fully featured one in vmm.ko.

The new RTC emulation supports all interrupt modes: periodic, update ended
and alarm. It is also capable of maintaining the date/time and NVRAM contents
across virtual machine reset. Also, the date/time fields can now be modified
by the guest.

Since bhyve now emulates both the PIT and the RTC there is no need for
"Legacy Replacement Routing" in the HPET so get rid of it.

The RTC device state can be inspected via bhyvectl as follows:
bhyvectl --vm=vm --get-rtc-time
bhyvectl --vm=vm --set-rtc-time=<unix_time_secs>
bhyvectl --vm=vm --rtc-nvram-offset=<offset> --get-rtc-nvram
bhyvectl --vm=vm --rtc-nvram-offset=<offset> --set-rtc-nvram=<value>

Reviewed by: tychon
Discussed with: grehan
Differential Revision: https://reviews.freebsd.org/D1385
MFC after: 2 weeks

9 years agoCheck for multiplication integer overflow in CHECK_EHDR
emaste [Tue, 30 Dec 2014 22:04:24 +0000 (22:04 +0000)]
Check for multiplication integer overflow in CHECK_EHDR

The initial fix in r276374 is valid only for 64-bit objects. Revert it
and return an error in CHECK_EHDR if the multiplication would overflow.

The original buffer overflow issue was found with the security/afl
fuzzer and has upstream elftoolchain ticket 462. The 32-bit object issue
with r276374 found by antoine@ during an i386 exp-run.

Sponsored by: The FreeBSD Foundation

9 years agoRemove the svn:executable property from iscsi.4.
wblock [Tue, 30 Dec 2014 21:55:50 +0000 (21:55 +0000)]
Remove the svn:executable property from iscsi.4.

PR: 196380
Submitted by: Trond.Endrestol@ximalas.info
MFC after: 1 week

9 years agoConvert nullfs hash lock from a mutex to an rwlock.
mjg [Tue, 30 Dec 2014 21:41:35 +0000 (21:41 +0000)]
Convert nullfs hash lock from a mutex to an rwlock.

9 years agoConvert vfs hash lock from a mutex to an rwlock.
mjg [Tue, 30 Dec 2014 21:40:45 +0000 (21:40 +0000)]
Convert vfs hash lock from a mutex to an rwlock.

9 years agoMerge ^/head r274961 through r276418.
dim [Tue, 30 Dec 2014 20:23:03 +0000 (20:23 +0000)]
Merge ^/head r274961 through r276418.

9 years agoMove the explanation for examples before the example itself. Add
wblock [Tue, 30 Dec 2014 20:20:18 +0000 (20:20 +0000)]
Move the explanation for examples before the example itself.  Add
numerous QEMU examples and explanations supplied by sbruno, with thanks
to Ingo Schwarze for help with the mdoc markup.  Code, text, testing,
proofreading, cinematography, stunts, and the haunting theme song
supplied by sbruno.

Submitted by: sbruno
Reviewed by: sbruno
MFC after: 1 week

9 years agoImport libcxxrt master 00bc29eb6513624824a6d7db2ebc768a4216a604.
dim [Tue, 30 Dec 2014 20:01:06 +0000 (20:01 +0000)]
Import libcxxrt master 00bc29eb6513624824a6d7db2ebc768a4216a604.

Interesting fixes:
76584a0  Reorganize code to use only 32bit atomic ops for 32bit platforms
30d2ae5  Implement __cxa_throw_bad_array_new_length

Reviewed by: bapt
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D1390

9 years agoUse BINUTILS_BOOTSTRAP knob for binutils only
emaste [Tue, 30 Dec 2014 18:42:53 +0000 (18:42 +0000)]
Use BINUTILS_BOOTSTRAP knob for binutils only

Previously it also disabled building elftoolchain bootstrap tools such as
strip(1).

Differential Revision: https://reviews.freebsd.org/D1398
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

9 years agoFix loader's ability to read the 10.1 release PowerPC ISOs. There appears to
nwhitehorn [Tue, 30 Dec 2014 16:55:53 +0000 (16:55 +0000)]
Fix loader's ability to read the 10.1 release PowerPC ISOs. There appears to
be some kind of problem with the version of makefs used for these disks.
There may be a better way to handle this problem, so I've set the MFC
timer for a fairly long time period.

MFC after: 2 weeks

9 years agoSet the page size in the virtio-mmio driver. Some backends, e.g QEMU, assume
andrew [Tue, 30 Dec 2014 12:47:44 +0000 (12:47 +0000)]
Set the page size in the virtio-mmio driver. Some backends, e.g QEMU, assume
a 1 byte page size until told otherwise.

Sponsored by: The FreeBSD Foundation

9 years agoAllow systems having a page size greater than 4K to use fewer
hselasky [Tue, 30 Dec 2014 09:20:29 +0000 (09:20 +0000)]
Allow systems having a page size greater than 4K to use fewer
scatter-gather XHCI TRB entries for its payload data. The XHCI
controller can handle at least 65536 bytes per scatter-gather list
entry.

MFC after: 1 week
Suggested by: Kohji Okuno <okuno.kohji@jp.panasonic.com>

9 years agovt_vga: fix an off-by-one error
royger [Tue, 30 Dec 2014 08:50:50 +0000 (08:50 +0000)]
vt_vga: fix an off-by-one error

This correctly sets the end of the memory region registered by vt_vga.

Reported by: marius

9 years agoPartially revert "vt: register the memory regions used by the vt drivers"
royger [Tue, 30 Dec 2014 08:50:07 +0000 (08:50 +0000)]
Partially revert "vt: register the memory regions used by the vt drivers"

Revert the EFI part of r276064 until I can test it properly on a real EFI
system. This was causing problems to people booting using UEFI and vt.

Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de>

9 years agoAdd missed flushing of data which can happen when "xhci_configure_mask()"
hselasky [Tue, 30 Dec 2014 08:33:51 +0000 (08:33 +0000)]
Add missed flushing of data which can happen when "xhci_configure_mask()"
is called from "xhci_configure_reset_endpoint()". Ensure the 3-strikes
error feature is always enabled except for ISOCHRONOUS transfers.

MFC after: 1 week
Suggested by: marius@

9 years agoRemove "svn:mergeinfo" property that was dragged along when these files were
neel [Tue, 30 Dec 2014 07:08:30 +0000 (07:08 +0000)]
Remove "svn:mergeinfo" property that was dragged along when these files were
svn copied in r273375.

Suggested by: ngie, gjb

9 years agoUse the correct loader.conf(5) entry for deferring the
gjb [Tue, 30 Dec 2014 03:35:26 +0000 (03:35 +0000)]
Use the correct loader.conf(5) entry for deferring the
mountroot prompt.

Prodded by: ian
Sponsored by: The FreeBSD Foundation

9 years agoUpdate elftoolchain to upstream rev 3136
emaste [Tue, 30 Dec 2014 03:25:42 +0000 (03:25 +0000)]
Update elftoolchain to upstream rev 3136

This fixes two strip(1) issues found during ports exp-run and adds a
string hash implementation which significantly speeds up certain
operations on objects with large numbers of symbols.

This also improves libdwarf handling for stripped objects with
.eh_frame or .debug_frame (but not other debug) sections.

PR: 196107
Sponsored by: The FreeBSD Foundation

9 years agoAdd a new locore.S that #includes the right (v4 or v6) implementation.
ian [Tue, 30 Dec 2014 03:19:46 +0000 (03:19 +0000)]
Add a new locore.S that #includes the right (v4 or v6) implementation.
The kernel build machinery really wants the entry point to be in a file
named locore.S so doing this avoids a bunch of changes to the build system
for relatively little benefit.

9 years agoRename locore.S to locore-v4.S and add a new locore-v6.S for starting up
ian [Tue, 30 Dec 2014 03:17:53 +0000 (03:17 +0000)]
Rename locore.S to locore-v4.S and add a new locore-v6.S for starting up
armv6/7 systems.  We need to use some new armv6/7 features at startup
and splitting the implemenations to separate files will be more maintainable
than adding even more #ifdef sections to locore.S.

Because of the standardized interfaces to cache and MMU operations in armv7,
we can tolerate the kernel being entered with caches enabled.  This allows
running u-boot and loader(8) with caches enabled, and the performance
improvement can be dramatic (boot times can be cut from over a minute
to under 30 seconds).  The new implementation also has more robust cache
and mmu sequences for launching AP cores, and it paves the way for
upcoming changes to the pmap code which will use the TEX remap feature.

Changes in mp_machdep.c work with the new behavior in locore-v6 mp_entry,
and also reuse the original boot-time page tables to get transitioned
from physical to virtual addressing before installing the normal tables.

Submitted by Svatopluk Kraus and Michal Meloun with some changes by me.

9 years agoExport MAXCPU to the assembler code, needing by upcoming changes to locore.S.
ian [Tue, 30 Dec 2014 02:58:34 +0000 (02:58 +0000)]
Export MAXCPU to the assembler code, needing by upcoming changes to locore.S.

9 years agoAdd armv6 implementations of these cache operations to avoid duplicating
ian [Tue, 30 Dec 2014 02:56:31 +0000 (02:56 +0000)]
Add armv6 implementations of these cache operations to avoid duplicating
the #ifdef stuff at multiple points the functions are called from.  Also
rework the armv7 implementations so that the invalidate operations work
from outermost to innermost cache level, and the writeback works from
inner to outer levels.

9 years agoAdd arm option ARM_NEW_PMAP, to allow us to begin adding the new pmap
ian [Tue, 30 Dec 2014 02:51:04 +0000 (02:51 +0000)]
Add arm option ARM_NEW_PMAP, to allow us to begin adding the new pmap
code alongside the existing implementation and quickly toggle between
the two implementations when testing.  Once the new code is past its
teething stage we can remove this option.

9 years agoInject #UD into the guest when it executes either 'MONITOR' or 'MWAIT' on
neel [Tue, 30 Dec 2014 02:44:33 +0000 (02:44 +0000)]
Inject #UD into the guest when it executes either 'MONITOR' or 'MWAIT' on
an AMD/SVM host.

MFC after: 1 week

9 years agoTurns out, this isn't only called from i386...
imp [Tue, 30 Dec 2014 02:39:47 +0000 (02:39 +0000)]
Turns out, this isn't only called from i386...

9 years agoThe sn driver doesn't actually include microcode at the current time,
imp [Tue, 30 Dec 2014 02:39:44 +0000 (02:39 +0000)]
The sn driver doesn't actually include microcode at the current time,
although it may in the future. Or not since the ositech cards that
might need it have become perhaps too rare to support.

9 years agoDelay dropping to the mountroot prompt for 10 seconds
gjb [Mon, 29 Dec 2014 22:32:39 +0000 (22:32 +0000)]
Delay dropping to the mountroot prompt for 10 seconds
in case the root device is not yet ready.

Sponsored by: The FreeBSD Foundation

9 years agomdoc: sort SEE ALSO.
joel [Mon, 29 Dec 2014 21:59:44 +0000 (21:59 +0000)]
mdoc: sort SEE ALSO.

9 years agomdoc: sort SEE ALSO.
joel [Mon, 29 Dec 2014 21:52:32 +0000 (21:52 +0000)]
mdoc: sort SEE ALSO.

9 years ago- No longer exclude malo(4) and mwl(4), they have been fixed in r275870
marius [Mon, 29 Dec 2014 20:33:34 +0000 (20:33 +0000)]
- No longer exclude malo(4) and mwl(4), they have been fixed in r275870
  and r275871 respectively to build with PAE enabled.
- For the PAE kernel configuration file, no longer exclude devices that
  are known to be 64-bit DMA clean from amd64.

MFC after: 3 days

9 years agolibelf: Do not read past end of buffer
emaste [Mon, 29 Dec 2014 20:23:42 +0000 (20:23 +0000)]
libelf: Do not read past end of buffer

Previously a corrupt ELF file could read beyond the end of e_rawfile.

Upstream elftoolchain ticket 462.  Found via the security/afl fuzzer.

Sponsored by: The FreeBSD Foundation

9 years agoRename DT_FEATURE_1 to DT_FEATURE
emaste [Mon, 29 Dec 2014 19:38:12 +0000 (19:38 +0000)]
Rename DT_FEATURE_1 to DT_FEATURE

Track r270303:

  This provides a minor cleanup in elfdump; there are otherwise no
  consumers in the tree.  Old SUN documentation can be found for either
  variant, but GNU binutils switched to DT_FEATURE around 2000.

Sponsored by: The FreeBSD Foundation

9 years agoRestore r276252 mdoc fix
emaste [Mon, 29 Dec 2014 19:27:10 +0000 (19:27 +0000)]
Restore r276252 mdoc fix

It was accidentally reverted in the elftoolchain update (r276371).

Sponsored by: The FreeBSD Foundation

9 years agoUpdate elftoolchain to upstream rev 3130
emaste [Mon, 29 Dec 2014 19:16:40 +0000 (19:16 +0000)]
Update elftoolchain to upstream rev 3130

This includes a number of libdwarf improvements (particularly DWARF4
related) and updates to elftoolchain tools such as strip(1). It also
includes a large number of miscellaneous fixes (memory leaks, sign and
cast warnings, integer overflow and underflow, etc.).

This is a merge of r276167,276170-276172 from the
projects/elftoolchain-update-r3130 branch.

Sponsored by: The FreeBSD Foundation

9 years agoFor building sys/boot/powerpc, get rid of the obsolete -mppc64bridge
dim [Mon, 29 Dec 2014 17:36:37 +0000 (17:36 +0000)]
For building sys/boot/powerpc, get rid of the obsolete -mppc64bridge
assembler flag.  No change in the generated code.

Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D1392

9 years agoAttach vtnet to virtio_mmio. Qemu provides this as an option with AArch64.
andrew [Mon, 29 Dec 2014 17:17:01 +0000 (17:17 +0000)]
Attach vtnet to virtio_mmio. Qemu provides this as an option with AArch64.

Sponsored by: The FreeBSD Foundation

9 years agomdoc: remove EOL whitespace.
joel [Mon, 29 Dec 2014 13:50:59 +0000 (13:50 +0000)]
mdoc: remove EOL whitespace.

9 years agosymlink(7): Note that stat(1) does not follow symlinks by default.
jilles [Mon, 29 Dec 2014 13:02:03 +0000 (13:02 +0000)]
symlink(7): Note that stat(1) does not follow symlinks by default.

MFC after: 1 week

9 years agoAllow virtio_mmio to attach to ofwbus. Qemu places these here on at least
andrew [Mon, 29 Dec 2014 11:02:18 +0000 (11:02 +0000)]
Allow virtio_mmio to attach to ofwbus. Qemu places these here on at least
the AArch64 virtual platform with the Linaro UEFI.

Sponsored by: The FreeBSD Foundation

9 years agoMerge ^/head r276347 through r276356.
dim [Mon, 29 Dec 2014 09:27:42 +0000 (09:27 +0000)]
Merge ^/head r276347 through r276356.

9 years agoUse -Wl, to pass options to the linker for PowerPC's boot1.chrp.
dim [Mon, 29 Dec 2014 09:24:21 +0000 (09:24 +0000)]
Use -Wl, to pass options to the linker for PowerPC's boot1.chrp.

MFC after: 3 days

9 years agoRemove dev/virtio/virtio.h include from BERI VirtIO
bryanv [Mon, 29 Dec 2014 00:35:44 +0000 (00:35 +0000)]
Remove dev/virtio/virtio.h include from BERI VirtIO

This header file contains prototypes and defines that only make
sense to the guest VirtIO device drivers.

Reviewed by: br

9 years agoIn contrib/binutils/bfd/elf32-ppc.c, avoid warnings about case values
dim [Mon, 29 Dec 2014 00:10:43 +0000 (00:10 +0000)]
In contrib/binutils/bfd/elf32-ppc.c, avoid warnings about case values
not being in the enumerated type 'enum elf_ppc_reloc_type', by casting
the switch argument to int.

MFC after: 3 days

9 years agoDon't use a sub-device/-vendor wildcard for probing MCS9922 as other
marius [Sun, 28 Dec 2014 21:36:20 +0000 (21:36 +0000)]
Don't use a sub-device/-vendor wildcard for probing MCS9922 as other
chips with the same device and vendor IDs actually may provide different
functionality. While at it, canonicalize the description to match other
MosChip UARTs.

PR: 186891
MFC after: 3 days

9 years agoUpdate comments (r4 is not used anywhere), use non-profiling entry macros.
ian [Sun, 28 Dec 2014 21:33:41 +0000 (21:33 +0000)]
Update comments (r4 is not used anywhere), use non-profiling entry macros.

9 years agoMerge ^/head r274961 through r276346.
dim [Sun, 28 Dec 2014 21:13:55 +0000 (21:13 +0000)]
Merge ^/head r274961 through r276346.

9 years agor245508 modified the NFS client's Setattr RPC to
rmacklem [Sun, 28 Dec 2014 21:13:52 +0000 (21:13 +0000)]
r245508 modified the NFS client's Setattr RPC to
use VA_UTIMES_NULL to indicate whether it should
set the time to the current tod on the server.
This had the side effect of making the NFS client
use the client's timestamp for exclusive create,
starting with FreeBSD9.2.
Unfortunately a bug in some Solaris NFS servers
causes these servers to return NFS_OK to the
Setattr RPC done during exclusive create, but not
actually set the file's mode, leaving the file's
mode == 0.
This patch restores the NFS client's behaviour to
use the server's tod for the exclusive open's
Setattr RPC, to avoid the Solaris server bug and
to restore the pre-FreeBSD9.2 NFS behaviour.

Discussed on: freebsd-fs
PR: 186293
MFC after: 3 months

9 years agoIn contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security
dim [Sun, 28 Dec 2014 21:06:03 +0000 (21:06 +0000)]
In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security
warnings.

MFC after: 3 days

9 years agoCorrect naming of sysctl pmtud_blackhole_activated_min_mss.
sbruno [Sun, 28 Dec 2014 20:56:03 +0000 (20:56 +0000)]
Correct naming of sysctl pmtud_blackhole_activated_min_mss.

Clarify some statements around PMTUD blackhole detection to make
the behavior more clear in the man page.

Submitted by: Mikhail <mp@lenta.ru>
MFC after: 2 weeks

9 years ago- Const'ify the ahci_ids table.
marius [Sun, 28 Dec 2014 20:42:28 +0000 (20:42 +0000)]
- Const'ify the ahci_ids table.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after: 3 days

9 years agoMerge ^/head r274961 through r276342.
dim [Sun, 28 Dec 2014 20:02:06 +0000 (20:02 +0000)]
Merge ^/head r274961 through r276342.

9 years agoFix the following -Werror warning from clang 3.5.0, while building
dim [Sun, 28 Dec 2014 19:55:44 +0000 (19:55 +0000)]
Fix the following -Werror warning from clang 3.5.0, while building
rtld-elf for powerpc 32 bit:

libexec/rtld-elf/powerpc/reloc.c:486:6: error: taking the absolute value of unsigned type 'Elf_Addr' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value]
        if (abs(offset) < 32*1024*1024) {     /* inside 32MB? */
            ^
libexec/rtld-elf/powerpc/reloc.c:486:6: note: remove the call to 'abs' since unsigned values cannot be negative
        if (abs(offset) < 32*1024*1024) {     /* inside 32MB? */
            ^~~
1 error generated.

Cast 'offset' to int, since that was intended, and should be safe to do
on architectures with 32-bit two's complement ints.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D1387

9 years agosysctl: don't modify oid_running for static nodes
mjg [Sun, 28 Dec 2014 19:24:01 +0000 (19:24 +0000)]
sysctl: don't modify oid_running for static nodes

It is necessary to prevent nodes from being destroyed while used, but static
ones cannot be destroyed.

9 years agoFix a "decl is not a prototype" error noticed by gcc (but not clang).
ian [Sun, 28 Dec 2014 19:05:32 +0000 (19:05 +0000)]
Fix a "decl is not a prototype" error noticed by gcc (but not clang).

9 years agoAdd cache maintenance functions which will be used by startup code to
ian [Sun, 28 Dec 2014 18:38:25 +0000 (18:38 +0000)]
Add cache maintenance functions which will be used by startup code to
initially set up the MMU.  Some day they may also be useful as part of
suspend/resume handling, when we get better at power management.

Submitted by: Svatopluk Kraus <onwahe@gmail.com>,
              Michal Meloun <meloun@miracle.cz

9 years agoEliminate an unused macro whose name clashes now with a function in the
ian [Sun, 28 Dec 2014 18:26:15 +0000 (18:26 +0000)]
Eliminate an unused macro whose name clashes now with a function in the
new cpu-v6.h.  This should have been part of r276334.

9 years agoAdd new TLB and cache maintainence functions for armv6 and armv7. These
ian [Sun, 28 Dec 2014 18:19:05 +0000 (18:19 +0000)]
Add new TLB and cache maintainence functions for armv6 and armv7.  These
are inline functions that handle all the routine maintenance operations
except the flush-all and invalidate-all routines which are required only
during early kernel init.

These inline functions should be very much faster than the old mechanism
that involved jumping through the big cpufuncs table, especially for
common operations such as invalidating a single TLB entry.  Note that
nothing is calling these yet, this just is just required infrastructure
for upcoming changes to the pmap-v6 code.

9 years agoAdd new code to read and parse cpu identification data using the new CPUID
ian [Sun, 28 Dec 2014 18:12:56 +0000 (18:12 +0000)]
Add new code to read and parse cpu identification data using the new CPUID
mechanism defined for armv7 (and also present on some armv6 chips including
the arm1176 used on rpi).  The information is parsed into a global cpuinfo
structure, which will be used by (upcoming) new cache and tlb maintenance
code to handle cpu-specific variations of the maintence sequences.

Submitted by: Svatopluk Kraus <onwahe@gmail.com>,
              Michal Meloun <meloun@miracle.cz

9 years agoAdd ncurses to _LIBRARIES so that libmenu is correctly linked
antoine [Sun, 28 Dec 2014 15:38:50 +0000 (15:38 +0000)]
Add ncurses to _LIBRARIES so that libmenu is correctly linked

PR: ports/195782

9 years agoAdd PowerPC64 function descriptor support for dt_link.c
jhibbits [Sun, 28 Dec 2014 06:41:13 +0000 (06:41 +0000)]
Add PowerPC64 function descriptor support for dt_link.c

Summary:
PowerPC64 uses function descriptors in a section .opd, exporting the descriptors
to the symbol table.  This adds support for these into dt_link.c so that dtrace
USDT probes can be compiled.

Test Plan:
Tested only on powerpc64.  No regression testing has been performed, so I want
someone with x86 hardware to regression test this.

Tested on amd64 by markj

Reviewers: #dtrace, markj

Reviewed By: #dtrace, markj

Subscribers: markj

Differential Revision: https://reviews.freebsd.org/D1267

MFC after: 3 weeks

9 years agoAdd llvm patches corresponding to r276300, r276301 and r276324.
dim [Sun, 28 Dec 2014 02:33:13 +0000 (02:33 +0000)]
Add llvm patches corresponding to r276300, r276301 and r276324.