]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoProgram the AR_TSFOOR_THRESHOLD register with a default lifted from
adrian [Sun, 27 Apr 2014 23:35:05 +0000 (23:35 +0000)]
Program the AR_TSFOOR_THRESHOLD register with a default lifted from
the QCA HAL.

This fires off an interrupt if the TSF from the AP / IBSS peer is
wildly out of range.  I'll add some code to the ath(4) driver soon
which makes use of this.

TODO:

* verify this didn't break TDMA!

10 years agoFix the AR_SLEEP1 and AR_SLEEP2 definitions. Oops!
adrian [Sun, 27 Apr 2014 23:33:37 +0000 (23:33 +0000)]
Fix the AR_SLEEP1 and AR_SLEEP2 definitions. Oops!

Tested:

* AR9285, STA
* AR5416, STA

Obtained from: QCA, Linux ath9k

10 years agoDo a read-after-write to ensure the interrupt register update is flushed
adrian [Sun, 27 Apr 2014 23:31:42 +0000 (23:31 +0000)]
Do a read-after-write to ensure the interrupt register update is flushed
to the hardware.

The QCA HAL has a comment noting that if this isn't done, modifications
to AR_IMR_S2 before AR_IMR is flushed may produce spurious interrupts.

Obtained from: QCA

10 years agoDisable the beastie menu for EFI console which doesn't support ANSI codes
dteske [Sun, 27 Apr 2014 22:18:33 +0000 (22:18 +0000)]
Disable the beastie menu for EFI console which doesn't support ANSI codes
(so things like `at-xy', `clear', and other commands don't work making it
impossible to generate a living menu).

Reviewed by: nwhitehorn, emaste

10 years agoFix build
melifaro [Sun, 27 Apr 2014 21:17:54 +0000 (21:17 +0000)]
Fix build

Found by: ian
Pointyhat to: me

10 years agoNo EFI on i386. This unbreaks the i386 VT kernel build.
nwhitehorn [Sun, 27 Apr 2014 20:36:19 +0000 (20:36 +0000)]
No EFI on i386. This unbreaks the i386 VT kernel build.

10 years agoExplain why wbinv_all is SMP-safe in this case, and add a missing l2 cache
ian [Sun, 27 Apr 2014 20:26:15 +0000 (20:26 +0000)]
Explain why wbinv_all is SMP-safe in this case, and add a missing l2 cache
flush.  (Either it was missing here, or it isn't needed in the minidump
case.  Adding it here seems like the safer path to consistancy.)

10 years agoFlush and invalidate caches on each CPU as part of handling IPI_STOP.
ian [Sun, 27 Apr 2014 20:16:51 +0000 (20:16 +0000)]
Flush and invalidate caches on each CPU as part of handling IPI_STOP.

Flushing the caches is required before doing a panic dump, but ARM
doesn't provide a flavor of flush that gets broadcast to other cores.
However, all cores except one are stopped before doing a dump, so this
works around the lack of a global flush/invalidate by doing it locally
on each CPU as part of stopping.

Discussed with: cognet@

10 years agoThere is no difference between IPI_STOP and IPI_STOP_HARD on ARM, so
ian [Sun, 27 Apr 2014 20:01:59 +0000 (20:01 +0000)]
There is no difference between IPI_STOP and IPI_STOP_HARD on ARM, so
map them both to the same interrupt number like other arches do.

10 years agoRemove cpu_idcache_wbinv_all() from kdb_cpu_trap(), it's no longer needed.
ian [Sun, 27 Apr 2014 18:12:55 +0000 (18:12 +0000)]
Remove cpu_idcache_wbinv_all() from kdb_cpu_trap(), it's no longer needed.

This was added ca. 2004 for the purpose of ensuring the caches were in the
right state after the debugger set a breakpoint.  kdb_cpu_sync_icache()
was added in 2007 to handle that situation, and now the wbinv_all is
actually harmful because the operation isn't broadcast to other cores.

10 years agoImprove memory allocation model for rt_msg2() rtsock messages:
melifaro [Sun, 27 Apr 2014 17:41:18 +0000 (17:41 +0000)]
Improve memory allocation model for rt_msg2() rtsock messages:
 * memory is now allocated as early as possible, without holding locks.
 * sysctl users are now guaranteed to get a response (M_WAITOK buffer prealloc).
 * socket users are more likely to use on-stack buffer for replies.
 * standard kernel malloc/free functions are now used instead of radix wrappers.
rt_msg2() has been renamed to rtsock_msg_buffer().

MFC after: 1 month

10 years agoTurn off the full witness trace on console output.
gjb [Sun, 27 Apr 2014 16:40:40 +0000 (16:40 +0000)]
Turn off the full witness trace on console output.

On head/, or more specifically, when WITNESS is in
the kernel config, the console is spammed excessively
with lock order reversal between isofs and devfs.

Set debug.witness.trace=0 in the installer sysctl.conf
to avoid printing the full KDB stack backtrace.  This
does not prevent printing the lock order reversal has
happened, only lessens the console spam.

Sponsored by: The FreeBSD Foundation

10 years agoloader's GPT support on BIOS does not seem to like the root filesystem
nwhitehorn [Sun, 27 Apr 2014 16:34:59 +0000 (16:34 +0000)]
loader's GPT support on BIOS does not seem to like the root filesystem
being the last filesystem on the disk for some reason when made by this
script. Add a vestigial swap partition to allow this to boot with QEMU
BIOS.

10 years agoFinish connecting up installer UEFI support. If the kernel was booted using
nwhitehorn [Sun, 27 Apr 2014 15:58:07 +0000 (15:58 +0000)]
Finish connecting up installer UEFI support. If the kernel was booted using
EFI, set up the disks for an EFI system. If booted from BIOS/CSM, set up
for BIOS.

10 years agoSetting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel
hselasky [Sun, 27 Apr 2014 15:41:44 +0000 (15:41 +0000)]
Setting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel
LynxPoint USB 3.0 controllers found in MacBookPro 2013's.

MFC after: 2 days
Tested by: Huang Wen Hui <huanghwh@gmail.com>

10 years agoReport boot method (BIOS/UEFI) via sysctl machdep.bootmethod
emaste [Sun, 27 Apr 2014 15:14:59 +0000 (15:14 +0000)]
Report boot method (BIOS/UEFI) via sysctl machdep.bootmethod

Sponsored by: The FreeBSD Foundation

10 years agoRevert r258678. Make the led gpio-specifier match again the #gpio-cells
loos [Sun, 27 Apr 2014 13:10:51 +0000 (13:10 +0000)]
Revert r258678.  Make the led gpio-specifier match again the #gpio-cells
settings from the GPIO controller, which i had broken in r258678.  Restore
the active-low flag.

10 years agoFix the gpio-specifier decoding by respecting the GPIO controller's
loos [Sun, 27 Apr 2014 12:11:00 +0000 (12:11 +0000)]
Fix the gpio-specifier decoding by respecting the GPIO controller's
#gpio-cells property.

Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO
controller to implement its own mapping to deal with gpio-specifiers,
allowing the decoding of gpio-specifiers to be controller specific.

The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells =
<2>) and the FreeBSD standard (#gpio-cells = <3>).

It pass the gpio-specifier flag field to the children as an ivar variable so
they can act upon.

10 years agoRemove useless zeroing of RTAX_DST on error.
melifaro [Sun, 27 Apr 2014 10:43:48 +0000 (10:43 +0000)]
Remove useless zeroing of RTAX_DST on error.
Cleanup a bit.

MFC after: 1 month

10 years agoCleanup route_output() a bit.
melifaro [Sun, 27 Apr 2014 10:20:37 +0000 (10:20 +0000)]
Cleanup route_output() a bit.

MFC after: 1 month

10 years agoDo not delay freeing rtm. Bandaid added in r227061 is not needed since r227061,
melifaro [Sun, 27 Apr 2014 09:49:35 +0000 (09:49 +0000)]
Do not delay freeing rtm. Bandaid added in r227061 is not needed since r227061,

MFC after: 1 month

10 years agoSame as it was done in r263878 for invlrng_handler(), fix order of
kib [Sun, 27 Apr 2014 05:37:01 +0000 (05:37 +0000)]
Same as it was done in r263878 for invlrng_handler(), fix order of
checks for special pcid values in invlpg_pcid_handler().  Forst check
for special values, and only then do PCID-specific page invalidation.

Minor fix to the style compliance, declare local variable at the
function start.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoFix order of libthr and libc in the global dso list for sshd, by
kib [Sun, 27 Apr 2014 05:28:14 +0000 (05:28 +0000)]
Fix order of libthr and libc in the global dso list for sshd, by
explicitely linking main binary with -lpthread.  Before, libthr
appeared in the list due to dependency of one of the kerberos libs.
Due to the change in ld(1) behaviour of not copying NEEDED entries
from direct dependencies into the link results, the order becomes
reversed.

The libthr must appear before libc to properly interpose libc symbols
and provide working rtld locks implementation.  The symptom was sshd
hanging on rtld bind lock during nested symbol binding from a signal
handler.

Approved by: des (openssh maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoWhen vm_fault_copy_entry() is called from vm_map_protect() for a wired
kib [Sun, 27 Apr 2014 05:19:01 +0000 (05:19 +0000)]
When vm_fault_copy_entry() is called from vm_map_protect() for a wired
entry and performs the upgrade of the entry permissions from read-only
to read-write, we must allow to search for the source pages in the
backing object, like we do in the case of forking the read-only wired
entry. For the fork case, the behaviour is allowed by src_readonly
boolean, which in fact is only used to assert that read-write case
provides all source pages in the top-level object.

Eliminate the src_readonly variable.  Allow for the copy loop to look
into the backing objects, add explicit asserts to ensure that only
read-only and upgrade case actually does.

Expand comments. Change the panic call into assert.

Reported by: markj
Tested by: markj, pho (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoDon't need this now. VT does the same thing, but better.
nwhitehorn [Sun, 27 Apr 2014 02:28:32 +0000 (02:28 +0000)]
Don't need this now. VT does the same thing, but better.

Submitted by: gjb

10 years agoAdd vt_efifb to VT kernel configuration now that that actually works. This
nwhitehorn [Sun, 27 Apr 2014 02:22:21 +0000 (02:22 +0000)]
Add vt_efifb to VT kernel configuration now that that actually works. This
kernel will now boot on both BIOS and EFI systems without modification.
Equivalent functionality in GENERIC requires making vt(9) the default console
driver, which is probably appropriate at this point.

10 years agoIncrease the maximum framebuffer size to more reasonable values reflecting
nwhitehorn [Sun, 27 Apr 2014 02:20:51 +0000 (02:20 +0000)]
Increase the maximum framebuffer size to more reasonable values reflecting
the high-resolution boot consoles present on Open Firmware and EFI systems.

10 years agoMove up fibnum to ensure it is always defined.
melifaro [Sun, 27 Apr 2014 02:20:09 +0000 (02:20 +0000)]
Move up fibnum to ensure it is always defined.

Found by: ian
MFC with: r264987

10 years agoDisable vga if EFI framebuffer present. vt(9) should handle this internally
nwhitehorn [Sun, 27 Apr 2014 02:19:53 +0000 (02:19 +0000)]
Disable vga if EFI framebuffer present. vt(9) should handle this internally
based on efifb's higher priority, but it doesn't, and this at least lets
us build a kernel that boots on both BIOS and EFI systems for now.

10 years agoAdd script to setup bootable CD ISOs for both BIOS and EFI systems. Tested
nwhitehorn [Sun, 27 Apr 2014 01:06:02 +0000 (01:06 +0000)]
Add script to setup bootable CD ISOs for both BIOS and EFI systems. Tested
and working on QEMU. Actually using this script as the regular image
generator, like with the memstick one, will require that the kernel support
EFI too. In particular, the following two things are required:
1. vt(9) be the default console driver
2. vt_efifb and vt_vga be able to coexist usefully in the same kernel

One other note here is that this requires newfs_msdos and mdconfig, which is
really ugly. NetBSD's makefs at least seems to support FAT now. If that
actually works, it should be imported and we can get rid of the mdconfig mess.

10 years agoProvide a proper armv7 implementation of icache_sync_all rather than
ian [Sun, 27 Apr 2014 00:46:01 +0000 (00:46 +0000)]
Provide a proper armv7 implementation of icache_sync_all rather than
using armv7_idcache_wbinv_all, because wbinv_all doesn't broadcast the
operation to other cores.  In elf_cpu_load_file() use icache_sync_all()
and explain why it's needed (and why other sync operations aren't).

As part of doing this, all callers of cpu_icache_sync_all() were
inspected to ensure they weren't relying on the old side effect of
doing a wbinv_all along with the icache work.

10 years agoRevert to FAT12. This file system is apparently too small for FAT32, even
nwhitehorn [Sun, 27 Apr 2014 00:45:08 +0000 (00:45 +0000)]
Revert to FAT12. This file system is apparently too small for FAT32, even
if the old (pre r264889) newfs_msdos allowed it. And FAT12 seems to work
perfectly well.

10 years agoMake a dual-boot BIOS/UEFI memstick image. Testing required before this gets
nwhitehorn [Sun, 27 Apr 2014 00:40:18 +0000 (00:40 +0000)]
Make a dual-boot BIOS/UEFI memstick image. Testing required before this gets
renamed make-memstick.sh.

10 years agoUse logical rather than bitwise OR in if() expression.
ian [Sat, 26 Apr 2014 23:22:49 +0000 (23:22 +0000)]
Use logical rather than bitwise OR in if() expression.

10 years agoCall cpu_icache_sync_range() rather than sync_all since we know the range
ian [Sat, 26 Apr 2014 23:09:01 +0000 (23:09 +0000)]
Call cpu_icache_sync_range() rather than sync_all since we know the range
and flushing the entire icache is needlessly expensive.

10 years agoRemove useless `register' declarations.
melifaro [Sat, 26 Apr 2014 22:42:21 +0000 (22:42 +0000)]
Remove useless `register' declarations.

MFC after: 1 month

10 years agoA VMCS is always inactive when it exits the vmx_run() loop.
neel [Sat, 26 Apr 2014 22:37:56 +0000 (22:37 +0000)]
A VMCS is always inactive when it exits the vmx_run() loop.
Remove redundant code and the misleading comment that suggest otherwise.

Reviewed by: grehan@

10 years agoDetermine fibnum once in the beginning of route_output().
melifaro [Sat, 26 Apr 2014 22:32:04 +0000 (22:32 +0000)]
Determine fibnum once in the beginning of route_output().

MFC after: 1 month

10 years agoDecouple RTM_CHANGE from RTM_GET handling in rtsock.c:route_output().
melifaro [Sat, 26 Apr 2014 21:03:41 +0000 (21:03 +0000)]
Decouple RTM_CHANGE from RTM_GET handling in rtsock.c:route_output().
RTM_CHANGE is now handled inside route.c:rtrequest1_fib() as it should be.
Note change change handler is a separate function rtrequest1_fib_change().

MFC after: 1 month

10 years agoReword a comment block a bit; no functional changes.
ian [Sat, 26 Apr 2014 20:27:58 +0000 (20:27 +0000)]
Reword a comment block a bit; no functional changes.

10 years agoRetire smp_active. It was racey and caused demonstrated problems with
scottl [Sat, 26 Apr 2014 20:27:54 +0000 (20:27 +0000)]
Retire smp_active.  It was racey and caused demonstrated problems with
the cpufreq code.  Replace its use with smp_started.  There's at least
one userland tool that still looks at the kern.smp.active sysctl, so
preserve it but point it to smp_started as well.

Discussed with: peter, jhb
MFC after: 3 days
Obtained from: Netflix

10 years agoFlesh out imx_uart_init() so that we're not relying on u-boot to init
ian [Sat, 26 Apr 2014 20:03:04 +0000 (20:03 +0000)]
Flesh out imx_uart_init() so that we're not relying on u-boot to init
the hardware (meaning uarts other than the console will work).

10 years agoFix gcc build, initialize off variable.
andreast [Sat, 26 Apr 2014 19:30:04 +0000 (19:30 +0000)]
Fix gcc build, initialize off variable.

10 years agoThe freescale imx uart driver works for the whole i.MX family, so rename the
ian [Sat, 26 Apr 2014 17:56:39 +0000 (17:56 +0000)]
The freescale imx uart driver works for the whole i.MX family, so rename the
header file to not have "5xx" in the name.

10 years agoApparently this is supposed to be FAT32, not FAT12.
nwhitehorn [Sat, 26 Apr 2014 17:51:41 +0000 (17:51 +0000)]
Apparently this is supposed to be FAT32, not FAT12.

10 years agomake_dtb.sh is designed to be used in a kernel build environment where
imp [Sat, 26 Apr 2014 16:58:35 +0000 (16:58 +0000)]
make_dtb.sh is designed to be used in a kernel build environment where
MACHINE is defined to the target's value, not the host's
value. However, in Makefile.inc1, it is still defined to be the host's
value. Make the makedtb target work by expanding TARGET in the
existance test, and passing MACHINE=$TARGET in the call to make_dtb.sh

10 years agoAdd EFI support to the installer. This requires that the kernel provide
nwhitehorn [Sat, 26 Apr 2014 16:55:38 +0000 (16:55 +0000)]
Add EFI support to the installer. This requires that the kernel provide
a sysctl to determine what firmware is in use. This sysctl does not exist
yet, so the following blocks are in front of the wheels:
- I've provisionally called this "hw.platform" after the equivalent thing
  on PPC
- The logic to check the sysctl is short-circuited to always choose BIOS.
  There's a comment in the top of the file about how to turn this off.

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

10 years agoStop calling imx51_ccm_foo() clock functions from imx6 code. Instead
ian [Sat, 26 Apr 2014 16:48:09 +0000 (16:48 +0000)]
Stop calling imx51_ccm_foo() clock functions from imx6 code.  Instead
define a few imx_ccm_foo() functions that are implemented by the imx51 or
imx6 ccm code.  Of course, the imx6 ccm code is still more a wish than
reality, so for now its implementations just return hard-coded numbers.

10 years agoUse "hash" value in rtalloc_mpath_fib() instead of RTF_ANNOUNCE flag.
melifaro [Sat, 26 Apr 2014 16:46:33 +0000 (16:46 +0000)]
Use "hash" value in rtalloc_mpath_fib() instead of RTF_ANNOUNCE flag.
Hashing method is the same as in in6_src.c. (Probably we need better one).

MFC after: 2 weeks

10 years agoAdd generation of an EFI filesystem to hold boot1.efi. This is a near-exact
nwhitehorn [Sat, 26 Apr 2014 16:34:22 +0000 (16:34 +0000)]
Add generation of an EFI filesystem to hold boot1.efi. This is a near-exact
copy of the code from boot1.chrp again.

The resulting image is installed to /boot/boot1.efifat. If dd'ed to an 800K
"efi" partition, it should result in a bootable system.

10 years agoRemove sa_equal() definition since it is already defined in net/route.h.
melifaro [Sat, 26 Apr 2014 16:12:39 +0000 (16:12 +0000)]
Remove sa_equal() definition since it is already defined in net/route.h.

Noted by: ian
MFC after: 2 weeks

10 years agoUnify sa_equal() macro usage.
melifaro [Sat, 26 Apr 2014 14:52:03 +0000 (14:52 +0000)]
Unify sa_equal() macro usage.

MFC after: 2 weeks

10 years agoInitialize rssi variable.
kevlo [Sat, 26 Apr 2014 14:39:58 +0000 (14:39 +0000)]
Initialize rssi variable.

10 years agodate(1): Forgot to update manpage date in r264968
dumbbell [Sat, 26 Apr 2014 13:53:04 +0000 (13:53 +0000)]
date(1): Forgot to update manpage date in r264968

MFC after: 1 week
MFC with: 264968

10 years agoCorrectly set the sysctl format to Alphanumeric, rather than letting it default.
markm [Sat, 26 Apr 2014 13:21:28 +0000 (13:21 +0000)]
Correctly set the sysctl format to Alphanumeric, rather than letting it default.

Approved by: security-officer(des)

10 years agodate(1): Add "-R" flag to use RFC 2822 date and time output format
dumbbell [Sat, 26 Apr 2014 13:05:56 +0000 (13:05 +0000)]
date(1): Add "-R" flag to use RFC 2822 date and time output format

As stated in the man page, this is equivalent to use "%a, %d %b %Y %T %z"
as the output format while LC_TIME is set to the "C" locale.

This is compatible with date(1) from the GNU core utilities.

10 years agoAdd sysctl OIDs showing the actual size and capacity of the swap zone.
des [Sat, 26 Apr 2014 12:18:17 +0000 (12:18 +0000)]
Add sysctl OIDs showing the actual size and capacity of the swap zone.

MFC after: 1 week

10 years agoNote that the bug was fixed, and when.
des [Sat, 26 Apr 2014 12:16:40 +0000 (12:16 +0000)]
Note that the bug was fixed, and when.

10 years agor261913 broke DES passwords, because the only way they could work,
des [Sat, 26 Apr 2014 11:50:25 +0000 (11:50 +0000)]
r261913 broke DES passwords, because the only way they could work,
since they don't have an easily recognizable signature, was if they
were the default.  This commit rewrites crypt_set_format(3) etc to
address this:

 - Use a pointer instead of an index to identify the default format.
   This pointer is initialized at compile time to point to the first
   first element in the list of supported formats, eliminating the
   need for crypt_setdefault().  Using a pointer also simplifies
   iterating through the list.

 - Associate DES with the magic string "_", which takes care of the
   Extended DES format.

 - Finally, as a special case, if the salt does not match any known
   magic string but matches ^[./0-9A-Za-z]{13}$, it is assumed to be a
   DES password and is passed on to crypt_des().

MFC after: 1 week

10 years agoDefine startup order the same way as it is in dummynet.
trociny [Sat, 26 Apr 2014 08:05:16 +0000 (08:05 +0000)]
Define startup order the same way as it is in dummynet.

10 years agoAdd a UEFI kernel configuration to include the VT kernel, and
gjb [Fri, 25 Apr 2014 21:47:24 +0000 (21:47 +0000)]
Add a UEFI kernel configuration to include the VT kernel, and
replace the vt_vga driver with vt_efifb.

This is intended to help with snapshot builds only.

There is no intention to MFC this commit.

Sponsored by: The FreeBSD Foundation

10 years agoAdd a separate script to build the memstick.img and the
gjb [Fri, 25 Apr 2014 21:11:00 +0000 (21:11 +0000)]
Add a separate script to build the memstick.img and the
mini-memstick.img with UEFI support.

As the comments in the file suggest, 1) there must
be existing ${.OBJDIR}/usr/src/release/{release,bootonly};
2) TARGET/TARGET_ARCH must be amd64; and 3) it must be
a vt(4)-enabled kernel with vt_efifb (*not* vt_vga).

This script is not hooked into release/Makefile in any way
until further testing is complete.

Sponsored by: The FreeBSD Foundation

10 years agoThe FTDI product ID we've been calling BEAGLEBONE is actually TI XDS100V2,
ian [Fri, 25 Apr 2014 19:47:27 +0000 (19:47 +0000)]
The FTDI product ID we've been calling BEAGLEBONE is actually TI XDS100V2,
a jtag debugging product, which was used on early Beaglebone boards (later
boards used a standard FTDI 2232C product ID).  Change the name accordingly,
and also add an entry for XDS100V3, the latest version of that product
which has its own new product ID number.

10 years agoFix indentation for diff reduction with commits to follow.
gjb [Fri, 25 Apr 2014 19:43:18 +0000 (19:43 +0000)]
Fix indentation for diff reduction with commits to follow.

Sponsored by: The FreeBSD Foundation

10 years agoGeneralize FOO.clang to FOO.${COMPILER_TYPE}. There's no reason these
imp [Fri, 25 Apr 2014 19:25:57 +0000 (19:25 +0000)]
Generalize FOO.clang to FOO.${COMPILER_TYPE}. There's no reason these
need to be clang specific. Also generalize things a bit.

10 years agoSplit up the options into those used only by bsd.mk.* or sys.mk and
imp [Fri, 25 Apr 2014 19:25:53 +0000 (19:25 +0000)]
Split up the options into those used only by bsd.mk.* or sys.mk and
the rest. Add note of caution for the surprises that popped up. MK_SSP
is the only one used by sys.mk, and it likely needs even extra
attention.

10 years agoEliminate NO_INCS. It is used one place, and MK_TOOLCHAIN=no will
imp [Fri, 25 Apr 2014 19:25:45 +0000 (19:25 +0000)]
Eliminate NO_INCS. It is used one place, and MK_TOOLCHAIN=no will
handle the job just as well. Opt for simplicity rather than one more
option.

10 years agoNow that all the NO_foo expressed in this loop have been removed from
imp [Fri, 25 Apr 2014 19:25:37 +0000 (19:25 +0000)]
Now that all the NO_foo expressed in this loop have been removed from
the tree, start warning that NO_foo is deprecated. It was supposed to
be gone from the tree as a user-setting a long time ago...

10 years agoSpell NO_PROFILE= as MK_PROFILE=no.
imp [Fri, 25 Apr 2014 19:25:26 +0000 (19:25 +0000)]
Spell NO_PROFILE= as MK_PROFILE=no.

10 years agoNO_DEBUG_FILES -> MK_DEBUG_FILES=no in last remaining place.
imp [Fri, 25 Apr 2014 19:25:18 +0000 (19:25 +0000)]
NO_DEBUG_FILES -> MK_DEBUG_FILES=no in last remaining place.

10 years agoKill last remaining NO_INSTALLLIB in tree by converting it over to
imp [Fri, 25 Apr 2014 19:25:13 +0000 (19:25 +0000)]
Kill last remaining NO_INSTALLLIB in tree by converting it over to
MK_INSTALLIB=no.

10 years agoEliminate last vestigies of NO_MAN= in the tree. Also, remove
imp [Fri, 25 Apr 2014 19:25:05 +0000 (19:25 +0000)]
Eliminate last vestigies of NO_MAN= in the tree. Also, remove
ineffectual NOMAN= lines. These don't change the build at all.

10 years agoRemove NO_CTF, exccept as an undocumented compatibility
imp [Fri, 25 Apr 2014 19:25:00 +0000 (19:25 +0000)]
Remove NO_CTF, exccept as an undocumented compatibility
option. Convert all other uses to MK_CTF=no. Set MK_CTF=no rather than
the indirect WITHOUT_CDDL in filemon regression. It is expected that
NO_CTF will be removed in FreeBSD 12 entirely.

10 years agoRemove device type from the uftdi_devs table, enhance the jtag-skip feature.
ian [Fri, 25 Apr 2014 19:13:57 +0000 (19:13 +0000)]
Remove device type from the uftdi_devs table, enhance the jtag-skip feature.

Device type and revision is now determined from the bcdDevice field and
doesn't need to be in the table at all.  The feature that skips creation
of /dev/ttyU* entries for jtag and gpio interfaces is enhanced:

 - The feature is now optional, but enabled by default.  A tunable and
   sysctl are available to control it: hw.usb.uftdi.skip_jtag_interfaces.
 - We no longer assume interface #0 is the only jtag interface.  Up to
   eight interfaces per chip can be flagged as jtag.  (Current ftdi chips
   support a max of 4 interfaces; this leaves room for growth.)
 - Some manufacturers don't change the product ID or use the same ID for
   different devices intended for both serial-comms and jtag/gpio use.
   Often while the product ID is the same, the product name string is
   different, so it's now possible to search for the product name in a
   table of strings and get the set of non-tty interfaces from that table.

10 years agoRevert r264907 and r264908:
gjb [Fri, 25 Apr 2014 18:46:54 +0000 (18:46 +0000)]
Revert r264907 and r264908:

Restore make-memstick.sh back to its original state to
unbreak booting for machines that do not support GPT.

I have in-progress work to keep the MBR layout and add
the EFI partition, but it is not yet ready, and does
need at least one full release build to be certain it
does not break.

Sponsored by: The FreeBSD Foundation

10 years agoRespect and track the enable bit in the PCI configuration address word.
grehan [Fri, 25 Apr 2014 17:35:34 +0000 (17:35 +0000)]
Respect and track the enable bit in the PCI configuration address word.
Ignore writes, and return 0xff's, on config accesses when not set.
Behaviour now matches that seen on h/w.

Found with a NetBSD/amd64 guest.

Reviewed by: tychon
MFC after: 3 weeks

10 years agoFix spelling error.
bdrewery [Fri, 25 Apr 2014 15:27:19 +0000 (15:27 +0000)]
Fix spelling error.

MFC after: 3 days

10 years agoStyle fixes, mostly trailing whitespace elimination. No functional change.
asomers [Fri, 25 Apr 2014 14:35:30 +0000 (14:35 +0000)]
Style fixes, mostly trailing whitespace elimination.  No functional change.

Reported by: pho
MFC after: 3 weeks

10 years agoProvide a very basic stub for the 8042 PS/2 keyboard controller.
tychon [Fri, 25 Apr 2014 13:38:18 +0000 (13:38 +0000)]
Provide a very basic stub for the 8042 PS/2 keyboard controller.

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

10 years agoThe current API for adding rules with pool addresses is the following:
glebius [Fri, 25 Apr 2014 11:36:11 +0000 (11:36 +0000)]
The current API for adding rules with pool addresses is the following:

- DIOCADDADDR adds addresses and puts them into V_pf_pabuf
- DIOCADDRULE takes all addresses from V_pf_pabuf and links
  them into rule.

The ugly part is that if address is a table, then it is initialized
in DIOCADDRULE, because we need ruleset, and DIOCADDADDR doesn't
supply ruleset. But if address is a dynaddr, we need address family,
and address family could be different for different addresses in one
rule, so dynaddr is initialized in DIOCADDADDR.

This leads to the entangled state of addresses on V_pf_pabuf. Some are
initialized, and some not. That's why running pf_empty_pool(&V_pf_pabuf)
can lead to a panic on a NULL table address.

Since proper fix requires API/ABI change, for now simply plug the panic
in pf_empty_pool().

Reported by: danger

10 years agoAdd preliminary support for the Realtek RTL8188EUS and RTL8188ETV chipsets.
kevlo [Fri, 25 Apr 2014 08:01:22 +0000 (08:01 +0000)]
Add preliminary support for the Realtek RTL8188EUS and RTL8188ETV chipsets.

Committed over the TP-LINK TL-WN725N v2 (RTL8188EUS) on amd64 with WPA.

10 years agoConstify.
delphij [Fri, 25 Apr 2014 04:01:25 +0000 (04:01 +0000)]
Constify.

10 years agoPut my inner hobgoblin on a leash: These routines, at least, needed to
imp [Fri, 25 Apr 2014 02:29:29 +0000 (02:29 +0000)]
Put my inner hobgoblin on a leash: These routines, at least, needed to
be {} so they don't run in a subshell.

10 years agoStyle cleanup
gjb [Fri, 25 Apr 2014 01:55:14 +0000 (01:55 +0000)]
Style cleanup
 - Indent 1 full tab where needed
 - Use $() for shell exec
 - Insert a space between '$(( ))' parens

MFC After: 1 week
X-MFC-With: r264907
Sponsored by: The FreeBSD Foundation

10 years agoRefactor make-memstick.sh to avoid creating the 'dangerously
gjb [Fri, 25 Apr 2014 01:38:57 +0000 (01:38 +0000)]
Refactor make-memstick.sh to avoid creating the 'dangerously
dedicated' partition scheme, reported to cause the memstick.img
to fail to boot.

Similar to how make-memstick.sh worked on stable/8, use makefs(8)
to create the actual filesystem.  Then calculate the size of the
resulting image file, create the GPT partition scheme, then dd(1)
the filesystem created with makefs(8) to the freebsd-ufs GPT
partition.

This was tested on a known-working machine[1] for regression, and
a known-not-working machine[2] to ensure the boot issue has been
resolved.

Testers: myself [1], db [2]
MFC After: 1 week
Sponsored by: The FreeBSD Foundation

10 years agoAdd a SLEEP->SCAN transition. Without this a disassociate or scan
adrian [Fri, 25 Apr 2014 01:20:10 +0000 (01:20 +0000)]
Add a SLEEP->SCAN transition.  Without this a disassociate or scan
request during SLEEP results in a hang.

Whilst I'm here, add in some disabled code that will transition to RUN
if there's multicast traffic.  It's not needed for Atheros hardware but
it may be for other hardware.

Tested:

* AR5416, STA mode (powersave)
* AR5212, STA mode (powersave)

10 years agoFix subnet and default routes on different FIBs on the same subnet.
asomers [Thu, 24 Apr 2014 23:56:56 +0000 (23:56 +0000)]
Fix subnet and default routes on different FIBs on the same subnet.

These two bugs are closely related.  The root cause is that ifa_ifwithnet
does not consider FIBs when searching for an interface address.

sys/net/if_var.h
sys/net/if.c
Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr.  Those
functions will only return an address whose interface fib equals the
argument.

sys/net/route.c
Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib
arguments.

sys/netinet/in.c
Update in_addprefix to consider the interface fib when adding
prefixes.  This will prevent it from not adding a subnet route when
one already exists on a different fib.

sys/net/rtsock.c
sys/netinet/in_pcb.c
sys/netinet/ip_output.c
sys/netinet/ip_options.c
sys/netinet6/nd6.c
Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet.
In some cases it there wasn't a clear specific fib number to use.
In others, I was unable to test those functions so I chose
RT_DEFAULT_FIB to minimize divergence from current behavior.  I will
fix some of the latter changes along with PR kern/187553.

tests/sys/netinet/fibs_test.sh
tests/sys/netinet/udp_dontroute.c
tests/sys/netinet/Makefile
Revert r263738.  The udp_dontroute test was right all along.
However, bugs kern/187550 and kern/187553 cancelled each other out
when it came to this test.  Because of kern/187553, ifa_ifwithnet
searched the default fib instead of the requested one, but because
of kern/187550, there was an applicable subnet route on the default
fib.  The new test added in r263738 doesn't work right, however.  I
can verify with dtrace that ifa_ifwithnet returned the wrong address
before I applied this commit, but route(8) miraculously found the
correct interface to use anyway.  I don't know how.

Clear expected failure messages for kern/187550 and kern/187552.

PR: kern/187550
PR: kern/187552
Reviewed by: melifaro
MFC after: 3 weeks
Sponsored by: Spectra Logic

10 years agoFix beri_simplebus probing. It's not allowed to have two modules on the
brooks [Thu, 24 Apr 2014 23:28:09 +0000 (23:28 +0000)]
Fix beri_simplebus probing.  It's not allowed to have two modules on the
same bus with the same name.

Tweak the description so it's clear the BERI version attached.

Sponsored by: DARPA, AFRL

10 years agoAdd option WITHOUT_VI to not build/install vi. vi was the largest
imp [Thu, 24 Apr 2014 23:17:40 +0000 (23:17 +0000)]
Add option WITHOUT_VI to not build/install vi. vi was the largest
binary without a knob to turn it off.

10 years agoUse MK_OPENLDAP in preference to WITH_OPENLDAP and make it a default
imp [Thu, 24 Apr 2014 23:17:31 +0000 (23:17 +0000)]
Use MK_OPENLDAP in preference to WITH_OPENLDAP and make it a default
NO option to match the opt-in nature of the historical nature of this
option.

10 years agoModify the ioctl path to support querying things if the vap state is
adrian [Thu, 24 Apr 2014 23:12:40 +0000 (23:12 +0000)]
Modify the ioctl path to support querying things if the vap state is
SLEEP rather than RUN.

Without this things like 'ifconfig wlan0 list sta' don't work when the
NIC is power save.

Tested:

* AR5212, STA mode (with powersave)
* AR5416, STA mode (with powersave)

10 years agoFix the AR5211 power mode tracking stuff.
adrian [Thu, 24 Apr 2014 23:11:36 +0000 (23:11 +0000)]
Fix the AR5211 power mode tracking stuff.

Tested:

* AR5211, STA mode

10 years agoFix the AR5210 HAL code to store the association ID and restore it
adrian [Thu, 24 Apr 2014 23:11:18 +0000 (23:11 +0000)]
Fix the AR5210 HAL code to store the association ID and restore it
upon reset.

Tested:

* AR5210, STA mode

10 years agoFix ah_powerMode to be set at the correct place for the AR5210.
adrian [Thu, 24 Apr 2014 23:10:24 +0000 (23:10 +0000)]
Fix ah_powerMode to be set at the correct place for the AR5210.

Tested:

* AR5210, STA mode

10 years agoMerge from CheriBSD:
brooks [Thu, 24 Apr 2014 22:28:53 +0000 (22:28 +0000)]
Merge from CheriBSD:

commit 003649d9622ce252a2794ae5891ee7e7c209caca
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Wed Feb 5 18:32:09 2014 +0000

    Teach the FreeBSD/beri boot to "auto-detect" whether argument 4 (a3) is a
    memory size of pointer to a struct bootinfo * by looking at its value and
    seeing whether it is pointer-like.  If a pointer, assume it's a bootinfo
    and extract memsize from it instead; otherwise, use it as memsize directly.
    This allows kernels to support bootinfo being passed by loader (and boot2)
    while still supporting older Miniboot setups.

commit f7045af9a1e92b6bd92541fe5d25abf66d824e8f
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Thu Feb 6 13:45:34 2014 +0000

    When the module metadata pointer is available from loader, use it in the
    kernel.

commit 52e0e1ff2cba9dfcfab9e1d0a31fb7fdf7317450
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Thu Feb 6 19:57:48 2014 +0000

    In the BERI kernel boot code, extract 'boothowto' (which includes boot flags
    such as '-s') and 'envp' from passed module data.  Booting to single-user
    mode using boot flags now works.

Sponsored by: DARPA, AFRL

10 years agoLIBUNBOUND can be unconditionally set.
imp [Thu, 24 Apr 2014 21:18:29 +0000 (21:18 +0000)]
LIBUNBOUND can be unconditionally set.

10 years agoDon't need to make these conditional on MK_LIBCPLUSPLUS. They can be
imp [Thu, 24 Apr 2014 21:18:22 +0000 (21:18 +0000)]
Don't need to make these conditional on MK_LIBCPLUSPLUS. They can be
defined all the time without ill effect.

10 years agoLIBMILTER can be defined always. No need to restrict to only when
imp [Thu, 24 Apr 2014 21:18:14 +0000 (21:18 +0000)]
LIBMILTER can be defined always. No need to restrict to only when
we're building sendmail.

10 years agoAlways define LIBLDNS. We don't need to only define it when it is
imp [Thu, 24 Apr 2014 21:18:06 +0000 (21:18 +0000)]
Always define LIBLDNS. We don't need to only define it when it is
enabled.

10 years agoTurns out that bash whines line a spoiled three year old when it
imp [Thu, 24 Apr 2014 21:18:01 +0000 (21:18 +0000)]
Turns out that bash whines line a spoiled three year old when it
encounters empty function. Put the 'true' passifier back. This
effectively backs out r264857.

Submitted by: Garrett Cooper