]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agowlanstats: print timestamp
eadler [Wed, 12 Mar 2014 15:14:55 +0000 (15:14 +0000)]
wlanstats: print timestamp

Print timestamp in addition to data for more useful debugging.

Discussed with: adrian

10 years agoDo not vdrop() the tmpfs vnode until it is unlocked. The hold
kib [Wed, 12 Mar 2014 15:13:57 +0000 (15:13 +0000)]
Do not vdrop() the tmpfs vnode until it is unlocked.  The hold
reference might be the last, and then vdrop() would free the vnode.

Reported and tested by: bdrewery
MFC after: 1 week

10 years agoSince both netinet/ and netinet6/ call into netipsec/ and netpfil/,
glebius [Wed, 12 Mar 2014 14:29:08 +0000 (14:29 +0000)]
Since both netinet/ and netinet6/ call into netipsec/ and netpfil/,
the protocol specific mbuf flags are shared between them.

- Move all M_FOO definitions into a single place: netinet/in6.h, to
  avoid future  clashes.
- Resolve clash between M_DECRYPTED and M_SKIP_FIREWALL which resulted
  in a failure of operation of IPSEC and packet filters.

Thanks to Nicolas and Georgios for all the hard work on bisecting,
testing and finally finding the root of the problem.

PR: kern/186755
PR: kern/185876
In collaboration with: Georgios Amanakis <gamanakis gmail.com>
In collaboration with: Nicolas DEFFAYET <nicolas-ml deffayet.com>
Sponsored by: Nginx, Inc.

10 years agoMake ether_line really report an error when all input is invalid.
jmmv [Wed, 12 Mar 2014 12:27:13 +0000 (12:27 +0000)]
Make ether_line really report an error when all input is invalid.

The previous code failed to return an error condition when the whole input
was invalid due to improper handling of the sscanf return value.  Actually,
this failure was properly being caught by a test in
tools/regression/lib/libc/net/test-ether.t but was not noticed because
these tests are never run.  (On my way to fixing that ;-)

The fix applied here resembles the implementation of ether_line in NetBSD
modulo the setting of an errno value (which is not documented as an
expectation in the manpage anyway).

10 years agoFix description of WITHOUT_BMAKE's purpose.
jmmv [Wed, 12 Mar 2014 11:53:35 +0000 (11:53 +0000)]
Fix description of WITHOUT_BMAKE's purpose.

This variable exists to select fmake, not bmake.  (I suspect the comment
might have come from a time when this was named WITH_BMAKE.)

10 years agoRemove broken tests for eui64_line.
jmmv [Wed, 12 Mar 2014 10:59:51 +0000 (10:59 +0000)]
Remove broken tests for eui64_line.

This function is not public and brooks (initial committer adding the code)
suggests the deletion of the tests (which I don't know if they work)
instead of changing the visibility of the function.

10 years agoMake the strerror tests work without libtap.
jmmv [Wed, 12 Mar 2014 10:45:22 +0000 (10:45 +0000)]
Make the strerror tests work without libtap.

Just replace the simple calls to the library with ad-hoc code.  We should
later rewrite these with the ATF libraries anyway, which are part of the
base system.

10 years agoTurn a test precondition into a skip in the mdconfig tests.
jmmv [Wed, 12 Mar 2014 10:42:58 +0000 (10:42 +0000)]
Turn a test precondition into a skip in the mdconfig tests.

Tests that cannot be run because a precondition is not met should be
marked as skipped, not failed.  Do this for the tests in mdconfig that
first check if the caller user is root.

10 years agoFix sa tests.
jmmv [Wed, 12 Mar 2014 10:41:14 +0000 (10:41 +0000)]
Fix sa tests.

Small divergences in the output padding made some sa tests fail.  Just
trim all whitespace from the outputs and the golden files so comparisons
are less fragile and the tests pass again.

10 years agoOnly run the make tests when make is fmake.
jmmv [Wed, 12 Mar 2014 10:38:32 +0000 (10:38 +0000)]
Only run the make tests when make is fmake.

Because bmake is the default make being built, many of the tests here
fail due to differences between the two.  Just skip the tests for now
when using fmake.

10 years agoFix lastcomm tests under amd64.
jmmv [Wed, 12 Mar 2014 10:35:22 +0000 (10:35 +0000)]
Fix lastcomm tests under amd64.

Force the use of TZ=UTC and adjust data files accordingly.  I have no means
to verify that the data files for the other architectures are valid.

10 years agoUse correct types for sizeof() in the calculations for the malloc(9) sizes [1].
kib [Wed, 12 Mar 2014 10:25:26 +0000 (10:25 +0000)]
Use correct types for sizeof() in the calculations for the malloc(9) sizes [1].
While there, remove unneeded checks for failed allocations with M_WAITOK flag.

Submitted by: Conrad Meyer <cemeyer@uw.edu> [1]
MFC after: 1 week

10 years agoThe auio structure is only initialized when the vnode is symlink,
kib [Wed, 12 Mar 2014 10:23:51 +0000 (10:23 +0000)]
The auio structure is only initialized when the vnode is symlink,
avoid reading from it otherwise.

Submitted by: Conrad Meyer <cemeyer@uw.edu>
MFC after: 1 week

10 years agoMake ministat CRNL tolerant by stripping all isspace() from the tail
phk [Wed, 12 Mar 2014 08:54:29 +0000 (08:54 +0000)]
Make ministat CRNL tolerant by stripping all isspace() from the tail
end of input lines.

10 years agoAvoid segment fault when attempting to clean up cylinder group
mckusick [Wed, 12 Mar 2014 01:28:21 +0000 (01:28 +0000)]
Avoid segment fault when attempting to clean up cylinder group
buffer cache.

PR: 187221
Submitted by: Petr Lampa <lampa@fit.vutbr.cz>
Obtained from: Petr Lampa <lampa@fit.vutbr.cz>
MFC after: 1 week

10 years agoDelete stray clause 3 (Advertising clause) and renumber while i'm
imp [Tue, 11 Mar 2014 23:41:35 +0000 (23:41 +0000)]
Delete stray clause 3 (Advertising clause) and renumber while i'm
here.

Approved by: alc@

10 years agoRemove #include <machine/asmacros.h> from files that don't need it.
ian [Tue, 11 Mar 2014 22:47:04 +0000 (22:47 +0000)]
Remove #include <machine/asmacros.h> from files that don't need it.

10 years agoRemove the unreferenced DATA() macro. That leaves only GET_CURTHREAD_PTR()
ian [Tue, 11 Mar 2014 22:41:34 +0000 (22:41 +0000)]
Remove the unreferenced DATA() macro. That leaves only GET_CURTHREAD_PTR()
which was added by cognet in 2012, so remove the no-longer-applicable
license stuff that referred to all the old contents, and put in a
standard 2-clause BSD license (to cover the 6 lines of useful code left
in here).

10 years agoDon't try to return a vector to a caller that only cares if a vector
tychon [Tue, 11 Mar 2014 22:12:12 +0000 (22:12 +0000)]
Don't try to return a vector to a caller that only cares if a vector
is pending or not.

Approved by: neel (co-mentor)

10 years agoEnhance the mechanism that lets you configure the ubldr boot device by
ian [Tue, 11 Mar 2014 22:02:49 +0000 (22:02 +0000)]
Enhance the mechanism that lets you configure the ubldr boot device by
setting the u-boot environment variable loaderdev=.  It used to accept only
'disk' or 'net'.  Now it allows specification of unit, slice, and partition
as well.  In addition to the generic 'disk' it also accepts specific
storage device types such as 'mmc' or 'sata'.

If there isn't a loaderdev env var, the historical behavior is maintained.
It will use the first storage device it finds, or a network device if
no working storage device exists.

99% of the work on this was done by Patrick Kelsey, but I made some
changes, so if anything goes wrong, blame me.

Submitted by: Patrick Kelsey <kelsey@ieee.org>

10 years agoGarbage collect the old way of adding the libstdc++ include directories
dim [Tue, 11 Mar 2014 21:43:10 +0000 (21:43 +0000)]
Garbage collect the old way of adding the libstdc++ include directories
in clang's InitHeaderSearch.cpp.  This has been superseded by David
Chisnall's commit in r255321.

Moreover, if libc++ is used, the libstdc++ include directories should
not be in the search path at all.  These directories are now only used
if you pass -stdlib=libstdc++.

MFC after: 3 days
X-MFC-With: r261991

10 years agoRepair recognition of "CC" as an alias for the C++ compiler, since it
dim [Tue, 11 Mar 2014 21:11:43 +0000 (21:11 +0000)]
Repair recognition of "CC" as an alias for the C++ compiler, since it
was silently broken by upstream for a Windows-specific use-case.

Apparently some versions of CMake still rely on this archaic feature...

Reported by: rakuco
MFC after: 3 days
X-MFC-With: r261991

10 years agoMFV of 263039, tzdata2014a:
edwin [Tue, 11 Mar 2014 20:32:23 +0000 (20:32 +0000)]
MFV of 263039, tzdata2014a:

- Fix historical info about asia/Zion, Ukraine
- Fiji starts DST at 02:00 instead of 03:00
- Turkey will move to DST at 31 March this year.

10 years agoRemove clause 3 (the advertising clause), per the regent's letter.
imp [Tue, 11 Mar 2014 17:20:50 +0000 (17:20 +0000)]
Remove clause 3 (the advertising clause), per the regent's letter.

10 years agoRemove clause 3 (advertising clause), per regent's letter.
imp [Tue, 11 Mar 2014 17:08:45 +0000 (17:08 +0000)]
Remove clause 3 (advertising clause), per regent's letter.

10 years agoReplace the userspace atpic stub with a more functional vmm.ko model.
tychon [Tue, 11 Mar 2014 16:56:00 +0000 (16:56 +0000)]
Replace the userspace atpic stub with a more functional vmm.ko model.

New ioctls VM_ISA_ASSERT_IRQ, VM_ISA_DEASSERT_IRQ and VM_ISA_PULSE_IRQ
can be used to manipulate the pic, and optionally the ioapic, pin state.

Reviewed by: jhb, neel
Approved by: neel (co-mentor)

10 years agoUse panic rather than printf to "handle" an arm26 address exception
ian [Tue, 11 Mar 2014 16:53:03 +0000 (16:53 +0000)]
Use panic rather than printf to "handle" an arm26 address exception
(should never happen on arm32).  Pass the right arguments to panic for
the reset exception (which also should never happen).

10 years agoNo functional changes. Rewrite comments, use tabs consistantly, reorder
ian [Tue, 11 Mar 2014 16:48:46 +0000 (16:48 +0000)]
No functional changes.  Rewrite comments, use tabs consistantly, reorder
some of the functions so that similar things are grouped together.

10 years agoRemove some unnecessary indirection and jump right to the handler functions.
ian [Tue, 11 Mar 2014 15:46:03 +0000 (15:46 +0000)]
Remove some unnecessary indirection and jump right to the handler functions.

10 years agoSupport Last-Modified behind proxies which return UTC instead of GMT.
bdrewery [Tue, 11 Mar 2014 13:47:11 +0000 (13:47 +0000)]
Support Last-Modified behind proxies which return UTC instead of GMT.

The standard states that GMT must be used, but that UTC is equivalent. Still
parse UTC as otherwise this causes problems for pkg(8). It will refetch
the repository every time 'pkg update' or other remote operations
are used behind these proxies.

RFC2616: "All HTTP date/time stamps MUST be represented in Greenwich Mean
Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal
to UTC (Coordinated Universal Time).""

Approved by: bapt (mentor)
Reviewed by: des, peter
Sponsored by: EMC / Isilon Storage Division
MFC after: 1 week

10 years agoxen: add a hook to perform AP startup
royger [Tue, 11 Mar 2014 10:27:57 +0000 (10:27 +0000)]
xen: add a hook to perform AP startup

AP startup on PVH follows the PV method, so we need to add a hook in
order to diverge from bare metal.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/machdep.c:
 - Add hook for start_all_aps on native (using native_start_all_aps
   defined in mp_machdep).

amd64/amd64/mp_machdep.c:
 - Make some variables global because they will also be used by the
   Xen PVH AP startup code.
 - Use the start_all_aps hook to start APs.
 - Rename start_all_aps to native_start_all_aps.

amd64/include/smp.h:
 - Add declaration for native_start_all_aps.

x86/include/init.h:
 - Declare start_all_aps hook in init_ops.

x86/xen/pv.c:
 - Pick external declarations from mp_machdep.
 - Introduce Xen PV code to start APs on PVH.
 - Set start_all_aps init hook to use the Xen PVH implementation.

10 years agoxen: changes to hvm code in order to support PVH guests
royger [Tue, 11 Mar 2014 10:26:53 +0000 (10:26 +0000)]
xen: changes to hvm code in order to support PVH guests

On PVH we don't need to init the shared info page, or disable emulated
devices. Also, make sure PV IPIs are set before starting the APs.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

x86/xen/hvm.c:
 - Return early from functions that are no-ops on Xen PVH guests.
 - In order to make sure PV IPIs are setup before AP startup,
   initialize them in SI_SUB_SMP-1.

10 years agoxen: add hook for AP bootstrap memory reservation
royger [Tue, 11 Mar 2014 10:26:16 +0000 (10:26 +0000)]
xen: add hook for AP bootstrap memory reservation

This hook will only be implemented for bare metal, Xen doesn't require
any bootstrap code since APs are started in long mode with paging
enabled.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/machdep.c:
 - Set mp_bootaddress hook for bare metal.

x86/include/init.h:
 - Define mp_bootaddress in init_ops.

10 years agoxen: add an apic_enumerator for PVH
royger [Tue, 11 Mar 2014 10:25:08 +0000 (10:25 +0000)]
xen: add an apic_enumerator for PVH

On PVH there's no ACPI, so the CPU enumeration must be implemented
using Xen hypercalls.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

x86/xen/pvcpu_enum.c:
 - Enumerate avaiable vCPUs on PVH by using the VCPUOP_is_up
   hypercall.
 - Set vcpu_id for PVH guests.

conf/files.amd64:
 - Include the PV CPU enumerator in the XENHVM build.

10 years agoxen: use the same hypercall mechanism for XEN and XENHVM
royger [Tue, 11 Mar 2014 10:24:13 +0000 (10:24 +0000)]
xen: use the same hypercall mechanism for XEN and XENHVM

Currently XEN (PV) and XENHVM (PVHVM) ports use different ways to
issue hypercalls, unify this by filling the hypercall_page under HVM
also.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/include/xen/hypercall.h:
 - Unify Xen hypercall code by always using the PV way.

i386/i386/locore.s:
 - Define hypercall_page on i386 XENHVM.

x86/xen/hvm.c:
 - Fill hypercall_page on XENHVM kernels using the HVM method (only
   when running as an HVM guest).

10 years agoxen: implement hook to fetch and parse e820 memory map
royger [Tue, 11 Mar 2014 10:23:03 +0000 (10:23 +0000)]
xen: implement hook to fetch and parse e820 memory map

e820 memory map is fetched using a hypercall under Xen PVH, so add a
hook to init_ops in oder to diverge from bare metal and implement a
Xen variant.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

x86/include/init.h:
 - Add a parse_memmap hook to init_ops, that will be called to fetch
   and parse the memory map.

amd64/amd64/machdep.c:
 - Decouple the fetch and the parse of the memmap, so the parse
   function can be shared with Xen code.
 - Move code around in order to implement the parse_memmap hook.

amd64/include/pc/bios.h:
 - Declare bios_add_smap_entries (implemented in machdep.c).

x86/xen/pv.c:
 - Implement fetching of e820 memmap when running as a PVH guest by
   using the XENMEM_memory_map hypercall.

10 years agoxen: implement an early timer for Xen PVH
royger [Tue, 11 Mar 2014 10:20:42 +0000 (10:20 +0000)]
xen: implement an early timer for Xen PVH

When running as a PVH guest, there's no emulated i8254, so we need to
use the Xen PV timer as the early source for DELAY. This change allows
for different implementations of the early DELAY function and
implements a Xen variant for it.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

dev/xen/timer/timer.c:
dev/xen/timer/timer.h:
 - Implement Xen early delay functions using the PV timer and declare
   them.

x86/include/init.h:
 - Add hooks for early clock source initialization and early delay
   functions.

i386/i386/machdep.c:
pc98/pc98/machdep.c:
amd64/amd64/machdep.c:
 - Set early delay hooks to use the i8254 on bare metal.
 - Use clock_init (that will in turn make use of init_ops) to
   initialize the early clock source.

amd64/include/clock.h:
i386/include/clock.h:
 - Declare i8254_delay and clock_init.

i386/xen/clock.c:
 - Rename DELAY to i8254_delay.

x86/isa/clock.c:
 - Introduce clock_init that will take care of initializing the early
   clock by making use of the init_ops hooks.
 - Move non ISA related delay functions to the newly introduced delay
   file.

x86/x86/delay.c:
 - Add moved delay related functions.
 - Implement generic DELAY function that will use the init_ops hooks.

x86/xen/pv.c:
 - Set PVH hooks for the early delay related functions in init_ops.

conf/files.amd64:
conf/files.i386:
conf/files.pc98:
 - Add delay.c to the kernel build.

10 years agoxen: rework xen timer so it can be used early in boot process
royger [Tue, 11 Mar 2014 10:16:17 +0000 (10:16 +0000)]
xen: rework xen timer so it can be used early in boot process

This should not introduce any functional change, and makes the
functions suitable to be called before we have actually mapped the
vcpu_info struct on a per-cpu basis.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

dev/xen/timer/timer.c:
 - Remove citrical_{enter/exit}, the clock code will already be called
   with preemption disabled when needed. Add a comment to that regard
   in xentimer_get_timecount.
 - Allow xen_fetch_vcpu_time to be called with a specifc vcpu_info
   that will be used to fetch current time.
 - Assert that xentimer_et_start will always be called with preemption
   disabled.

10 years agoamd64: introduce hook for custom preload metadata parsers
royger [Tue, 11 Mar 2014 10:15:25 +0000 (10:15 +0000)]
amd64: introduce hook for custom preload metadata parsers

Add hooks to amd64 in order to have diverging implementations, since
on Xen PV the metadata is passed to the kernel in a different form.

Approbed by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/machdep.c:
 - Define init_ops for native.
 - Put native code inside of native_parse_preload_data hook.
 - Call the parse_preload_data in order to fill the metadata info.

x86/include/init.h:
 - Declare the init_ops struct.

x86/xen/pv.c:
 - Declare xen_init_ops that contains the Xen PV implementation of
   init_ops.
 - Implement the parse_preload_data for Xen PVH, the info is fetched
   from HYPERVISOR_start_info->cmd_line as provided by Xen.

10 years agohowto_names: unify declaration
royger [Tue, 11 Mar 2014 10:13:06 +0000 (10:13 +0000)]
howto_names: unify declaration

Approved by: gibbs
Sponsored by: Citrix Systems R&D

boot/i386/efi/bootinfo.c:
boot/i386/libi386/bootinfo.c:
boot/ia64/common/bootinfo.c:
boot/powerpc/ofw/metadata.c:
boot/powerpc/ps3/metadata.c:
boot/sparc64/loader/metadata.c:
boot/uboot/common/metadata.c:
boot/userboot/userboot/bootinfo.c:
i386/xen/xen_machdep.c:
 - Include sys/boot.h
 - Remove custom definition of howto_names.

sys/boot.h:
 - Define howto_names.

x86/xen/pv.c:
 - Include sys/boot.h

10 years agoxen: add and enable Xen console for PVH guests
royger [Tue, 11 Mar 2014 10:09:23 +0000 (10:09 +0000)]
xen: add and enable Xen console for PVH guests

This adds and enables the PV console used on XEN kernels to
GENERIC/XENHVM kernels in order for it to be used on PVH.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

dev/xen/console/console.c:
 - Define console_page.
 - Move xc_printf debug function from i386 XEN code to generic console
   code.
 - Rework xc_printf.
 - Use xen_initial_domain instead of open-coded checks for Dom0.
 - Gate the attach of the PV console to PV(H) guests.

dev/xen/console/xencons_ring.c:
 - Allow the PV Xen console to output earlier by directly signaling
   the event channel in start_info if the event channel is not yet
   initialized.
 - Use HYPERVISOR_start_info instead of xen_start_info.

i386/include/xen/xen-os.h:
 - Remove prototype for xc_printf since it's now declared in global
   xen-os.h

i386/xen/xen_machdep.c:
 - Remove previous version of xc_printf.
 - Remove definition of console_page (now it's defined in the console
   itself).
 - Fix some printf formatting errors.

x86/xen/pv.c:
 - Add some early boot debug messages using xc_printf.
 - Set console_page based on the value passed in start_info.

xen/xen-os.h:
 - Declare console_page and add prototype for xc_printf.

10 years agoxen: add macro to detect if running as Dom0
royger [Tue, 11 Mar 2014 10:07:55 +0000 (10:07 +0000)]
xen: add macro to detect if running as Dom0

Approved by: gibbs
Sponsored by: Citrix Systems R&D

xen/xen-os.h:
 - Add macro to detect if running as Dom0.

10 years agoxen: add PV/PVH kernel entry point
royger [Tue, 11 Mar 2014 10:07:01 +0000 (10:07 +0000)]
xen: add PV/PVH kernel entry point

Add the PV/PVH entry point and the low level functions for PVH
early initialization.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/genassym.c:
 - Add __FreeBSD_version define to assym.s so it can be used for the
   Xen notes.

amd64/amd64/locore.S:
 - Make bootstack global so it can be used from Xen kernel entry
   point.

amd64/amd64/xen-locore.S:
 - Add Xen notes to the kernel.
 - Add the Xen PV entry point, that is going to call hammer_time_xen.

amd64/include/asmacros.h:
 - Add ELFNOTE macros.

i386/xen/xen_machdep.c:
 - Define HYPERVISOR_start_info for the XEN i386 PV port, which is
   going to be used in some shared code between PV and PVH.

x86/xen/hvm.c:
 - Define HYPERVISOR_start_info for the PVH port.

x86/xen/pv.c:
 - Introduce hammer_time_xen which is going to perform early setup for
   Xen PVH:
    - Setup shared Xen variables start_info, shared_info and
      xen_store.
    - Set guest type.
    - Create initial page tables as FreeBSD expects to find them.
    - Call into native init function (hammer_time).

xen/xen-os.h:
 - Declare HYPERVISOR_start_info.

conf/files.amd64:
 - Add amd64/amd64/locore.S and x86/xen/pv.c to the list of files.

10 years agoamd64/i386: switch IPI handlers to C code.
royger [Tue, 11 Mar 2014 10:03:29 +0000 (10:03 +0000)]
amd64/i386: switch IPI handlers to C code.

Move asm IPIs handlers to C code, so both Xen and native IPI handlers
share the same code.

Reviewed by: jhb
Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/apic_vector.S:
i386/i386/apic_vector.s:
 - Remove asm coded IPI handlers and instead call the newly introduced
   C variants.

amd64/amd64/mp_machdep.c:
i386/i386/mp_machdep.c:
 - Add C coded clones to the asm IPI handlers (moved from
   x86/xen/hvm.c).

i386/include/smp.h:
amd64/include/smp.h:
 - Add prototypes for the C IPI handlers.

x86/xen/hvm.c:
 - Move the C IPI handlers to mp_machdep and call those in the Xen IPI
   handlers.

i386/xen/mp_machdep.c:
 - Add dummy IPI handlers to the i386 Xen PV port (this port doesn't
   support SMP).

10 years agoFixed MSI interrupt allocation and handling.
edavis [Tue, 11 Mar 2014 06:07:12 +0000 (06:07 +0000)]
Fixed MSI interrupt allocation and handling.
Fixed a DMA mapping leak that occurs when defragmenting packet chains.

Approved by: davidch (mentor)
MFC after: 1 week

10 years agoRevert r262994 for now, it fails to boot on armv5.
ian [Tue, 11 Mar 2014 04:25:12 +0000 (04:25 +0000)]
Revert r262994 for now, it fails to boot on armv5.

10 years agoPass the actual baudrate to tty_init_console(). This defines the initial
marcel [Tue, 11 Mar 2014 03:20:10 +0000 (03:20 +0000)]
Pass the actual baudrate to tty_init_console(). This defines the initial
baudrate of the device special file, and makes sure that on open(2) the
UART is programmed with the correct baudrate. This then eliminates the
need in uart_tty_param() to override the speed setting.

10 years agoNow that the PUSHFRAME and PULLFRAME macros are used only in the swi
ian [Tue, 11 Mar 2014 03:19:43 +0000 (03:19 +0000)]
Now that the PUSHFRAME and PULLFRAME macros are used only in the swi
entry/exit code, they don't need to be macros.  Now they're just inline
code, and rewritten to use shorter instruction sequences.

10 years agoallow the kern.cryptodevallowsoft sysctl to enable symetric/hashes too...
jmg [Tue, 11 Mar 2014 01:45:46 +0000 (01:45 +0000)]
allow the kern.cryptodevallowsoft sysctl to enable symetric/hashes too...
This will allow us to more easily test the software versions of these
routines...

Considering that we've never had an software asymetric implmentation,
it's doubtful anyone has this enabled...

10 years agosome minor clean up.. Always _ZERO memory so mtx_init won't panic...
jmg [Tue, 11 Mar 2014 01:41:09 +0000 (01:41 +0000)]
some minor clean up.. Always _ZERO memory so mtx_init won't panic...

use the proper macro instead of hand rolling it...

Reviewed by: jhb (only the malloc change)
MFC after: 1 week

10 years agolibbsdstat: fix warnings, set WARNS
eadler [Tue, 11 Mar 2014 01:10:44 +0000 (01:10 +0000)]
libbsdstat: fix warnings, set WARNS

libbsdstat can build with WARNS=6 with a one line change.

10 years agoCorrect a typo in nlm_find_host_by_addr(): the intention of the
delphij [Tue, 11 Mar 2014 00:25:55 +0000 (00:25 +0000)]
Correct a typo in nlm_find_host_by_addr(): the intention of the
code is to give "<unknown>" rather than comparing the buffer
against it.

MFC after: 2 weeks

10 years agoMFV r262983:
delphij [Tue, 11 Mar 2014 00:23:50 +0000 (00:23 +0000)]
MFV r262983:

4638 Panic in ZFS via rfs3_setattr()/rfs3_write(): dirtying snapshot!

illumos/illumos-gate@2144b121c08e0eb676cc6ca4662ebbc9f9c22fe3

10 years agoExport _libc_arm_fpu_present as a private symbol to be used by other
andrew [Tue, 11 Mar 2014 00:21:49 +0000 (00:21 +0000)]
Export _libc_arm_fpu_present as a private symbol to be used by other
system libraries, for example libm.

10 years agoArrange for arm fork_trampoline() to return to userland via the standard
ian [Mon, 10 Mar 2014 22:52:32 +0000 (22:52 +0000)]
Arrange for arm fork_trampoline() to return to userland via the standard
swi_exit code in exception.S instead of having its own inline expansion
of the DO_AST and PULLFRAME macros.  That means that now all references
to the PUSH/PULLFRAME and DO_AST macros are localized to exception.S,
so move the macros themselves into there and remove them from asmacros.h

10 years agoChange the way the asm GET_CURTHREAD_PTR() macro is defined so that code
ian [Mon, 10 Mar 2014 22:38:07 +0000 (22:38 +0000)]
Change the way the asm GET_CURTHREAD_PTR() macro is defined so that code
using it doesn't have to have an "AST_LOCALS" macro somewhere in the file.

10 years agoRepair a few minor mismerges from r262261 in the clang-sparc64 project
dim [Mon, 10 Mar 2014 21:58:38 +0000 (21:58 +0000)]
Repair a few minor mismerges from r262261 in the clang-sparc64 project
branch.  This is also to minimize differences with upstream.

MFC after: 3 weeks
X-MFC-With: r262613

10 years agoRemove vestigial global, no-longer used since SVN r262904.
dteske [Mon, 10 Mar 2014 21:37:40 +0000 (21:37 +0000)]
Remove vestigial global, no-longer used since SVN r262904.

10 years agoWhitespace.
dteske [Mon, 10 Mar 2014 21:35:27 +0000 (21:35 +0000)]
Whitespace.

10 years agoMove the exception vector table (so-called "page0" data) into exception.S
ian [Mon, 10 Mar 2014 19:36:26 +0000 (19:36 +0000)]
Move the exception vector table (so-called "page0" data) into exception.S
and eliminate vectors.S.  All low-level exception handling is now
consolidated into exception.S.

Along with moving the default FIQ handler, change it to disable FIQs
before returning.  An FIQ should never happen, but if it does, it's got
to be disabled as part of ignoring it.

In general, we have hand-wavy support for FIQs that probably hasn't been
used for 10 years and probably doesn't work (almost certainly doesn't
work for SMP because it only updates the vector on the current cpu).  This
change doesn't really make the overall situation any better or worse.

10 years agoEliminate irq_dispatch.S. Move the data items it contained into arm/intr.c
ian [Mon, 10 Mar 2014 18:10:09 +0000 (18:10 +0000)]
Eliminate irq_dispatch.S.  Move the data items it contained into arm/intr.c
and the functionality it provided into arm/exception.S.  Rename the main
irq handling routine from arm_handler_execute() to arm_irq_handler() to
make it more congruent with how other exception handlers are named, and
also update its signature to reflect what has long been reality: it is
passed just a trapframe pointer, no interrupt number argument.

10 years agoPass the size of the top-level table to map when mapping the table instead
jhb [Mon, 10 Mar 2014 16:07:45 +0000 (16:07 +0000)]
Pass the size of the top-level table to map when mapping the table instead
of the size of the pointer.

Reported by: Coverity
Coverity CID: 1147171

10 years agoAdd the makefile forgotten in previous commit
bapt [Mon, 10 Mar 2014 15:59:50 +0000 (15:59 +0000)]
Add the makefile forgotten in previous commit

10 years agoAdd a mailer.conf example to use dma
bapt [Mon, 10 Mar 2014 14:36:27 +0000 (14:36 +0000)]
Add a mailer.conf example to use dma

10 years agoUpdate libucl to 2014-03-03
bapt [Mon, 10 Mar 2014 10:39:29 +0000 (10:39 +0000)]
Update libucl to 2014-03-03

10 years agoUpdate libucl to 2014-03-02 version which fixes an important bug when parsing empty...
bapt [Mon, 10 Mar 2014 10:23:43 +0000 (10:23 +0000)]
Update libucl to 2014-03-02 version which fixes an important bug when parsing empty arrays

10 years agoIgnore USB keyboard driver calls from critical sections.
hselasky [Mon, 10 Mar 2014 08:52:30 +0000 (08:52 +0000)]
Ignore USB keyboard driver calls from critical sections.

Reported by: Oliver Pinter <oliver.pntr@gmail.com>
MFC after: 1 week

10 years agoAlso tag the current HAL power mode in ar9300_set_power_mode().
adrian [Mon, 10 Mar 2014 06:05:26 +0000 (06:05 +0000)]
Also tag the current HAL power mode in ar9300_set_power_mode().

10 years agoMigrate the chip power mode status to public ath_hal, rather than the
adrian [Mon, 10 Mar 2014 06:03:35 +0000 (06:03 +0000)]
Migrate the chip power mode status to public ath_hal, rather than the
private per-chip HAL.

This allows the ah_osdep.[ch] code to check whether the power state is
valid for doing chip programming.

It should be a no-op for normal driver work but it does require a
clean kernel/module rebuild, as the size of HAL structures have changed.

Now, this doesn't track whether the hardware is ACTUALLY awake,
as NETWORK_SLEEP wakes the chip up for a short period when traffic
is received.  This doesn't actually set the power mode to AWAKE, so
we have to be careful about how we touch things.

But it's enough to start down the path of implementing station mode
chipset power savings, as a large part of the silliness is making
sure the chip is awake during periodic calibration / ANI and
random places where transmit may be occuring.  I'd rather not a repeat
of debugging power save on ath9k, where races with calibration
and transmit path stuff took a couple years to shake out.

Tested:

* AR5416, STA mode

10 years agoMake the default exception handler vectors point to where I thought they
ian [Mon, 10 Mar 2014 01:34:38 +0000 (01:34 +0000)]
Make the default exception handler vectors point to where I thought they
were already pointing: the default handlers (not a panic that says there
is no default handler).

10 years agottys(5): Pseudo-terminals are not listed and the network keyword is obsolete.
jilles [Sun, 9 Mar 2014 22:38:11 +0000 (22:38 +0000)]
ttys(5): Pseudo-terminals are not listed and the network keyword is obsolete.

10 years agoFix ncal tests so that they run cleanly with prove.
jmmv [Sun, 9 Mar 2014 22:16:39 +0000 (22:16 +0000)]
Fix ncal tests so that they run cleanly with prove.

Basically just make the test plan match what is actually being run.

10 years agoFix pkill tests so that they run cleanly with prove.
jmmv [Sun, 9 Mar 2014 22:14:20 +0000 (22:14 +0000)]
Fix pkill tests so that they run cleanly with prove.

This fixes a pgrep test that assumed that PID 2 was named g_event.  This
does not seem to be the case any longer (and I don't know if it ever was
in all possible setups).

Change this test to use the idle loop instead and determine its expected
PID using ps without assuming any specific ID.

10 years agoFix yacc tests so that they run cleanly with prove.
jmmv [Sun, 9 Mar 2014 22:05:23 +0000 (22:05 +0000)]
Fix yacc tests so that they run cleanly with prove.

First, change the driver to run the installed yacc instead of the one from
/usr/obj (which might not be there), just as we (intend to) do with all
other tests.

Second, regenerate the expected output files from scratch.  Based on visual
inspection, the differences seem OK.  But this highlights that the tests in
here are too fragile and, possibly, useless: we should be testing the
behavior of the generated program, not the literal output.  Something to be
addressed later.

10 years agoFix sed tests so that they run cleanly with prove.
jmmv [Sun, 9 Mar 2014 21:56:29 +0000 (21:56 +0000)]
Fix sed tests so that they run cleanly with prove.

10 years agoRemove all traces of support for ARM chips prior to the arm9 series. We
ian [Sun, 9 Mar 2014 21:12:31 +0000 (21:12 +0000)]
Remove all traces of support for ARM chips prior to the arm9 series.  We
never actually ran on these chips (other than using SA1 support in an
emulator to do the early porting to FreeBSD long long ago).  The clutter
and complexity of some of this code keeps getting in the way of other
maintenance, so it's time to go.

10 years agoChange the terminal type/class for enabled serial lines to 3wire. This
marcel [Sun, 9 Mar 2014 21:06:22 +0000 (21:06 +0000)]
Change the terminal type/class for enabled serial lines to 3wire. This
allows us to change the uart(4) driver to not hardcode specific line
settings for the serial console.

A terminal type of 3wire makes sure the console still works when no DCD
signal is present, which preserves behviour. When it is known that the
terminal server (or DCE in general) provides DCD, a terminal type/class
of std can be used. This has the effect of being logged out when one
disconnects from the console -- improving security overall.

Likewise, when uart(4) does not fixate the baudrate, one can change
the terminal type/class to set a specific baudrate. An operator can use
this to change the console speed mid-flight, without needing a reboot.
Of course it helps in this respect if and when the firmware can be
configured from the OS.

The above mentioned capabilities depend on uart(4) being changed, which
is to happen next.

10 years agoAdd 3wire and std as terminal types/classes. These are similar to
marcel [Sun, 9 Mar 2014 20:51:14 +0000 (20:51 +0000)]
Add 3wire and std as terminal types/classes. These are similar to
the existing terminal types/classes that have the baudrate suffix,
but differ in that no baudrate is set/defined.

The purpose of these new types/classes is to allow them to be used
for the serial console. Currently the uart(4) driver fixates the
baudrate and the CLOCAL flag, which means that it doesn't matter
whether you give it std.<baud> or 3wire.<baud> as the terminal type
to getty and what exactly <baud> is set to. It's being overridden
by uart(4). The goal is to change uart(4) not to override these
settings.

10 years agoFix printf tests so that they run cleanly with prove.
jmmv [Sun, 9 Mar 2014 19:37:01 +0000 (19:37 +0000)]
Fix printf tests so that they run cleanly with prove.

10 years agoFix m4 tests so that they run cleanly with prove.
jmmv [Sun, 9 Mar 2014 19:25:53 +0000 (19:25 +0000)]
Fix m4 tests so that they run cleanly with prove.

10 years agoThe arm exception entry points currently vector through a function pointer
ian [Sun, 9 Mar 2014 18:08:27 +0000 (18:08 +0000)]
The arm exception entry points currently vector through a function pointer
to the actual handler routine.  All the pointers are static-intialized to
the only handlers available, and yet various platform-specific inits still
set those pointers (to the values they're already initialized to).  Begin
to drain the swamp by removing all the redundant external declarations and
runtime setting of the pointers that's scattered around various places.

10 years agoMake undefined exception entry MPSAFE.
ian [Sun, 9 Mar 2014 15:36:56 +0000 (15:36 +0000)]
Make undefined exception entry MPSAFE.

The old code used static storage to preserve a couple registers while
setting up the trapframe for the main handler.  Doing so was the last
leftover crumbs from the days when a low-level debugger was hooked into
the exception entry code.

Now the exception entry sequence is essentially the same as for the
other exceptions, which still involves needlessly indirecting through
a function pointer which points to the same code on every platform.
Removing that indirection will be handled as a separate cleanup.

This work is based on an analysis by Juergen Weiss.

10 years agoWhen a thread begins life it doesn't own the VFP hardware state on any cpu.
ian [Sun, 9 Mar 2014 14:54:05 +0000 (14:54 +0000)]
When a thread begins life it doesn't own the VFP hardware state on any cpu.

10 years agoAlways call vfp_discard() on thread death, not just when the VFP is
ian [Sun, 9 Mar 2014 14:24:05 +0000 (14:24 +0000)]
Always call vfp_discard() on thread death, not just when the VFP is
enabled.  In vfp_discard(), if the state in the VFP hardware belongs to
the thread which is dying, NULL out pcpu fpcurthread to indicate the
state currently in the hardware belongs to nobody.

Submitted by: Juergen Weiss
Pointy hat to: me

10 years agokldconfig: Remove some code for compatibility with FreeBSD 4.x.
jilles [Sun, 9 Mar 2014 13:19:37 +0000 (13:19 +0000)]
kldconfig: Remove some code for compatibility with FreeBSD 4.x.

Verified using md5(1).

10 years agovarious formating fixes, use NUL for NUL bytes..
jmg [Sun, 9 Mar 2014 07:45:59 +0000 (07:45 +0000)]
various formating fixes, use NUL for NUL bytes..

drop out dated perf numbers (can't imagine people are still running
Pentium MMX 166's anymore)...

bump date...

drop max length of salt of 8 since _PASSWORD_LEN is now large, 128..
and state the max length of the salt depends upon the module,
sha-{256,512} have a max salt of 16..

recommend 8 characters of salt instead of just 2...

MFC after: 1 week

10 years agoRemove all dregs of a per-thread undefined-exception-mode stack. This is
ian [Sun, 9 Mar 2014 03:49:06 +0000 (03:49 +0000)]
Remove all dregs of a per-thread undefined-exception-mode stack.  This is
a leftover from the days when a low-level debugger had hooks in the
undefined exception vector and needed stack space to function.  These days
it effectively isn't used because we switch immediately to the svc32 mode
stack on exception entry.  For that, the single undef mode stack per core
that gets set up at init time works fine.

The stack wasn't necessary but it was harmful, because the space for it
was carved out of the normal per-thread svc32 stack, in effect cutting
that 8K stack in half.  If svc32 mode used more than 4k of stack space it
wandered down into the undef mode stack, and then an undef exception would
overwrite a couple words on the stack while switching to svc32 mode,
corrupting the scv32 stack.  Having another stack abut the bottom of the
svc32 stack also effectively mooted the guard page below the stack.

This work is based on analysis and patches submitted by Juergen Weiss.

10 years agoRework the VFP code that handles demand-based save and restore of state.
ian [Sun, 9 Mar 2014 03:00:03 +0000 (03:00 +0000)]
Rework the VFP code that handles demand-based save and restore of state.

The old code was full of complexity that would only matter if the
kernel itself used the VFP hardware.  Now that's reduced to either killing
the userland process or panicking the kernel on an illegal VFP instruction.

This removes most of the complexity from the assembler code, reducing it
to just calling the save code if the outgoing thread used the VFP.

The routine that stores the VFP state now takes a flag that indicates
whether the hardware should be disabled after saving state.  Right now it
always is, but this makes the code ready to be used by get/set_mcontext()
(doing so will be addressed in a future commit).

Remove the arm-specific pc_vfpcthread from struct pcpu and use the MI
field pc_fpcurthread instead.

Reviewed by: cognet

10 years agoRemove bogus define that causes compile errors. Most of the defines
imp [Sun, 9 Mar 2014 02:28:30 +0000 (02:28 +0000)]
Remove bogus define that causes compile errors.  Most of the defines
for SAM9X are going away soonish anyway (once FDT works), but until
then...

10 years agoFix panic "_mtx_lock_sleep: recursed on non-recursive mutex ttymtx" caused when
neel [Sun, 9 Mar 2014 02:07:15 +0000 (02:07 +0000)]
Fix panic "_mtx_lock_sleep: recursed on non-recursive mutex ttymtx" caused when
acquiring the tty lock in bvm_tty_close(). Instead just assert that the tty
lock is held before calling callout_reset().

10 years agoUpdate board definition for WANDBOARD-QUAD to match crochet.
gjb [Sun, 9 Mar 2014 02:00:48 +0000 (02:00 +0000)]
Update board definition for WANDBOARD-QUAD to match crochet.

Sponsored by: The FreeBSD Foundation

10 years agoFollow r262916 with one more config file that references a renamed common.c
ian [Sun, 9 Mar 2014 01:52:21 +0000 (01:52 +0000)]
Follow r262916 with one more config file that references a renamed common.c

10 years agoinstall: Use posix_spawnp() for starting strip and improve error messages.
jilles [Sat, 8 Mar 2014 23:05:28 +0000 (23:05 +0000)]
install: Use posix_spawnp() for starting strip and improve error messages.

10 years agoBack out r262921. I don't know what I was thinking, but it is lame.
imp [Sat, 8 Mar 2014 19:59:52 +0000 (19:59 +0000)]
Back out r262921. I don't know what I was thinking, but it is lame.

10 years agosh: Successfully do nothing when killing a terminated job.
jilles [Sat, 8 Mar 2014 19:44:34 +0000 (19:44 +0000)]
sh: Successfully do nothing when killing a terminated job.

If a job has terminated but is still known, silently do nothing when using
the kill builtin with the job specifier. Formerly, the shell called kill()
with the process group ID that might have been reused.

10 years agoCall ieee80211_dump_pkt() based on IFF_DUMPPKTS().
rpaulo [Sat, 8 Mar 2014 19:35:31 +0000 (19:35 +0000)]
Call ieee80211_dump_pkt() based on IFF_DUMPPKTS().

MFC after: 3 days

10 years agoFix another bug in multicast filtering. i.MX uses 6 bits from MSB in
hrs [Sat, 8 Mar 2014 14:58:39 +0000 (14:58 +0000)]
Fix another bug in multicast filtering.  i.MX uses 6 bits from MSB in
LE CRC32 for the hash value, not the lowest 6 bits in BE CRC32.

Tested by: Takanori Sawada
PR: arm/187179

10 years agoMove AIC related stuff to own file.
imp [Sat, 8 Mar 2014 06:06:50 +0000 (06:06 +0000)]
Move AIC related stuff to own file.

10 years agoProperly round on unmapping.
imp [Sat, 8 Mar 2014 06:06:42 +0000 (06:06 +0000)]
Properly round on unmapping.

10 years agoMake at91_soc_id() public.
imp [Sat, 8 Mar 2014 05:03:56 +0000 (05:03 +0000)]
Make at91_soc_id() public.