]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoImprot pf.c 1.636 from OpenBSD
bapt [Sun, 27 Oct 2013 20:52:09 +0000 (20:52 +0000)]
Improt pf.c 1.636 from OpenBSD

Original log:
Make sure pd2 has a pointer to the icmp header in the payload; fixes
panic seen with some some icmp types in icmp error message payloads.

Obtained from: OpenBSD

10 years agoImport pf.c 1.635 and pf_lb.c 1.4 from OpenBSD
bapt [Sun, 27 Oct 2013 20:44:42 +0000 (20:44 +0000)]
Import pf.c 1.635 and pf_lb.c 1.4 from OpenBSD

Stricter state checking for ICMP and ICMPv6 packets: include the ICMP type

in one port of the state key, using the type to determine which
side should be the id, and which should be the type. Also:
- Handle ICMP6 messages which are typically sent to multicast
  addresses but recieve unicast replies, by doing fallthrough lookups
  against the correct multicast address.  - Clear up some mistaken
  assumptions in the PF code:
- Not all ICMP packets have an icmp_id, so simulate
  one based on other data if we can, otherwise set it to 0.
  - Don't modify the icmp id field in NAT unless it's echo
  - Use the full range of possible id's when NATing icmp6 echoy

Difference with OpenBSD version:
- C99ify the new code
- WITHOUT_INET6 safe

Reviewed by: glebius
Obtained from: OpenBSD

10 years agoClean up the debug printing in libproc a bit. In particular:
markj [Sun, 27 Oct 2013 20:39:10 +0000 (20:39 +0000)]
Clean up the debug printing in libproc a bit. In particular:

* Don't print any error messages to stderr unless DEBUG is defined.
* Add a DPRINTFX macro for use when errno isn't set.
* Print the error string from libelf when appropriate.

10 years agoFix typo.
kib [Sun, 27 Oct 2013 18:52:09 +0000 (18:52 +0000)]
Fix typo.

MFC after: 3 days

10 years agoProvide forward declaration for struct ifnet. Consumers
glebius [Sun, 27 Oct 2013 17:27:06 +0000 (17:27 +0000)]
Provide forward declaration for struct ifnet. Consumers
of this header don't need contents of struct.

10 years agoAlmost all if_clone consumers do not care about if_clone_event.
glebius [Sun, 27 Oct 2013 17:14:33 +0000 (17:14 +0000)]
Almost all if_clone consumers do not care about if_clone_event.
Do not force them to include sys/eventhandler.h. Those who
utilize EVENTHANDLER(9), will see the declaration.

10 years agoInclude lock.h before mutex.h.
glebius [Sun, 27 Oct 2013 17:12:31 +0000 (17:12 +0000)]
Include lock.h before mutex.h.

10 years agoRemove the last dregs of trapframe_t. It turns out only arm was using
ian [Sun, 27 Oct 2013 17:09:23 +0000 (17:09 +0000)]
Remove the last dregs of trapframe_t.  It turns out only arm was using
this type, so remove it to make arm code more consistant with other
platforms.  Thanks to bde@ for pointing out only arm used trapframe_t.

10 years agoSeveral small fixes for the amd64 minidump code.
kib [Sun, 27 Oct 2013 16:31:12 +0000 (16:31 +0000)]
Several small fixes for the amd64 minidump code.

In report_progress(), use nitems(progress_track) instead of manually
hard-coding array size.  Wrap long line.

In blk_write(), code verifies that ptr and pa cannot be non-zero
simultaneously.  The later check for the page-alignment of the ptr
argument never triggers due to pa != 0 always implying ptr == NULL.  I
believe that the intent was to ensure that physicall address passed is
page-aligned, since the address is (temporary) mapped for the duration
of the page write.

Clear the progress_track.visited fields when starting minidump.  If
minidump is restarted or taken second time during the system lifetime,
progress is not printed otherwise, making operator suspectible to the
dump status.

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

10 years agoMove new pf includes to the pf directory. The pfvar.h remain
glebius [Sun, 27 Oct 2013 16:25:57 +0000 (16:25 +0000)]
Move new pf includes to the pf directory. The pfvar.h remain
in net, to avoid compatibility breakage for no sake.

The future plan is to split most of non-kernel parts of
pfvar.h into pf.h, and then make pfvar.h a kernel only
include breaking compatibility.

Discussed with: bz

10 years agoWhen reentering kdb, typically due to a bug causing trap or assert in
kib [Sun, 27 Oct 2013 16:20:52 +0000 (16:20 +0000)]
When reentering kdb, typically due to a bug causing trap or assert in
the code executed in the context of debugger, do not be ashamed to
inform loudly about the re-entry.  Also, print the backtrace before
obliterating current stack with longjmp, allowing the operator to see
a place which caused the bug.

The change should make it less mysterious debugging the ddb itself.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoIf the initial attempt to open /dev/ksyms fails, kldload the ksyms module
markj [Sun, 27 Oct 2013 16:18:48 +0000 (16:18 +0000)]
If the initial attempt to open /dev/ksyms fails, kldload the ksyms module
and retry.

10 years agoConvert the lockstat(1) man page to mdoc and make sure that it gets
markj [Sun, 27 Oct 2013 16:01:11 +0000 (16:01 +0000)]
Convert the lockstat(1) man page to mdoc and make sure that it gets
installed. Additionally, remove Solaris-specific sections and references,
and replace example outputs with output from lockstat on FreeBSD, since
lockstat's output contains stack traces.

This change also removes some examples that don't seem to work properly on
FreeBSD. The examples should be re-added when lockstat is fixed.

Reported by: avg
MFC after: 1 week

10 years agoAlways build ubldr as a soft-float binary as there is no support for VFP
andrew [Sun, 27 Oct 2013 14:27:11 +0000 (14:27 +0000)]
Always build ubldr as a soft-float binary as there is no support for VFP
this early on in the boot process.

10 years agoTurn on VM_KMEM_SIZE_SCALE on 32-bit as well as 64-bit PowerPC.
nwhitehorn [Sun, 27 Oct 2013 14:03:51 +0000 (14:03 +0000)]
Turn on VM_KMEM_SIZE_SCALE on 32-bit as well as 64-bit PowerPC.

Requested by: alc
MFC after: 1 month

10 years agoUpdate the hard-float version of the fenv functions to use the VFP unit.
andrew [Sun, 27 Oct 2013 10:44:22 +0000 (10:44 +0000)]
Update the hard-float version of the fenv functions to use the VFP unit.
Any other floating-point unit is unsupported on ARM.

10 years agoFix a deadlock when trying to power off a USB device. The deadlock
hselasky [Sun, 27 Oct 2013 10:09:53 +0000 (10:09 +0000)]
Fix a deadlock when trying to power off a USB device. The deadlock
happens because the code in question is trying to modify the parent
USB port registers outside the USB explore thread.

MFC after: 3 days

10 years agoMention in login.conf.5 which fields may be infinite and how to specifify infinity.
eadler [Sun, 27 Oct 2013 04:59:18 +0000 (04:59 +0000)]
Mention in login.conf.5 which fields may be infinite and how to specifify infinity.
The number of ways to indicate this confuses people.

PR: docs/100196
Reported by: "Dr. Markus Waldeck" <waldeck@gmx.de>
Reported by: Jamie Landeg Jones <jamie.landeg.jones@gmail.com>

10 years agoAll man pages refer to FreeBSD so there is no need to mention "In .Fx"
eadler [Sun, 27 Oct 2013 04:49:40 +0000 (04:49 +0000)]
All man pages refer to FreeBSD so there is no need to mention "In .Fx"

10 years agoEliminate a compiler warning about extraneous parens.
ian [Sun, 27 Oct 2013 03:29:38 +0000 (03:29 +0000)]
Eliminate a compiler warning about extraneous parens.

10 years agoOops, one more instance of ARM_NOCACHE_KVA_SIZE was hiding under the couch.
ian [Sun, 27 Oct 2013 03:24:46 +0000 (03:24 +0000)]
Oops, one more instance of ARM_NOCACHE_KVA_SIZE was hiding under the couch.
This should have been cleaned up along with r257201.

10 years agoRetire arm_remap_nocache() and the data and constants associated with it.
ian [Sun, 27 Oct 2013 03:13:26 +0000 (03:13 +0000)]
Retire arm_remap_nocache() and the data and constants associated with it.

The only remaining user was the code that allocates bounce pages for armv4
busdma.  It's not clear why bounce pages would need uncached memory, but
if that ever changes, kmem_alloc_attr() would be the way to get it.

10 years agoRemove #include <machine/frame.h> from all the arm code that doesn't
ian [Sun, 27 Oct 2013 01:34:10 +0000 (01:34 +0000)]
Remove #include <machine/frame.h> from all the arm code that doesn't
really need it.  That would be almost everywhere it was included.  Add
it in a couple files that really do need it and were previously getting
it by accident via another header.

10 years agoRemove all #include <machine/pmap.h> from arm code. It's already
ian [Sun, 27 Oct 2013 00:51:46 +0000 (00:51 +0000)]
Remove all #include <machine/pmap.h> from arm code.  It's already
included by vm/pmap.h, which is a prerequisite for arm/machine/pmap.h
so there's no reason to ever include it directly.

Thanks to alc@ for pointing this out.

10 years agoFix build after r257162.
nwhitehorn [Sat, 26 Oct 2013 23:41:11 +0000 (23:41 +0000)]
Fix build after r257162.

10 years agoMaximize available kva space by doing static device mapping from the top
ian [Sat, 26 Oct 2013 23:13:20 +0000 (23:13 +0000)]
Maximize available kva space by doing static device mapping from the top
of the address space downwards, and then returning the lowest mapped
device address from initarm_lastaddr().  This adds over 500MB of kva
space compared to the old way of hardcoding the end address as 0xE0000000.

Also, pre-map most of the SoC's common memory-mapped devices using 1MB
section mappings so that all device access uses just a few TLB entries.
Graphics devices aren't mapped this way yet, but probably should be.

To provide this new functionality without pasting identical code into
multiple imxNN_machdep.c files, rework the imx machdep code so that
things common to the whole family of SoCs are in a new imx_machdep.c file.
The rewritten imxNN_machdep.c files contain just things specific to an
individual SoC.

10 years agoMake devices with registers into the KVA region work reliably. Without this,
nwhitehorn [Sat, 26 Oct 2013 20:57:26 +0000 (20:57 +0000)]
Make devices with registers into the KVA region work reliably. Without this,
previous KVA allocations (which the PMAP lazily invalidates) in TLB0 could
shadow device maps in TLB1. Add a big block comment about some of the
caveats with this approach.

10 years agoTry even harder to find a console before giving up.
nwhitehorn [Sat, 26 Oct 2013 20:06:50 +0000 (20:06 +0000)]
Try even harder to find a console before giving up.

10 years agoFix build with GCC.
bdrewery [Sat, 26 Oct 2013 19:59:42 +0000 (19:59 +0000)]
Fix build with GCC.

BIO_new_mem_buf takes a void* buf, but internally it never modifies the
buf. It assigns the buffer to another pointer and then marks it as
read-only. So deconsting it should be safe here.

Also fix warning about 'buf' possibly being unused in parse_cert()

Approved by: bapt
MFC after: 2 days
X-MFC-With: r257147

10 years agoHandle (in a slightly ugly way) ePAPR-type loaders that just place a
nwhitehorn [Sat, 26 Oct 2013 19:50:40 +0000 (19:50 +0000)]
Handle (in a slightly ugly way) ePAPR-type loaders that just place a
device tree into r3. Rather than worrying about mapping that tree, reserving
its space in the global physical memory space, etc., just copy it to some
memory after the kernel.

10 years agoBump initial TLB size. The kernel is not necessarily less than 16 MB any
nwhitehorn [Sat, 26 Oct 2013 19:49:09 +0000 (19:49 +0000)]
Bump initial TLB size. The kernel is not necessarily less than 16 MB any
more.

10 years agoFix an itt instruction. We need to execute both the mov and b instructions
andrew [Sat, 26 Oct 2013 19:09:56 +0000 (19:09 +0000)]
Fix an itt instruction. We need to execute both the mov and b instructions
when building for Thumb.

10 years agoStart splitting pfvar.h into internal and external parts.
glebius [Sat, 26 Oct 2013 18:59:58 +0000 (18:59 +0000)]
Start splitting pfvar.h into internal and external parts.

- Provide pf_altq.h that has only stuff needed for ALTQ.
- Start pf.h, that would have all constant values and
  eventually non-kernel structures.
- Build ALTQ w/o pfvar.h, include if_var.h, that before
  came via pollution.
- Build tcpdump w/o pfvar.h.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoThe MII layer shouldn't care about administrative status of an
glebius [Sat, 26 Oct 2013 18:40:17 +0000 (18:40 +0000)]
The MII layer shouldn't care about administrative status of an
interface. Make MII drivers forget about 'struct ifnet'.

Later plan is to provide an administrative downcall from ifnet
layer into drivers, to inform them about administrative status
change. If someone thinks that processing MII events for an
administratively down interface is a big problem, then drivers
would turn MII processing off.

The following MII drivers do evil things, like strcmp() on
driver name, so they still need knowledge of ifnet and thus
include if_var.h. They all need to be fixed:

sys/dev/mii/brgphy.c
sys/dev/mii/e1000phy.c
sys/dev/mii/ip1000phy.c
sys/dev/mii/jmphy.c
sys/dev/mii/nsphy.c
sys/dev/mii/rgephy.c
sys/dev/mii/truephy.c

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoBe a bit more flexible in how we find the console from the properties on
nwhitehorn [Sat, 26 Oct 2013 18:25:55 +0000 (18:25 +0000)]
Be a bit more flexible in how we find the console from the properties on
/chosen, following the list of allowed console properties in ePAPR. Also
do not require that stdin be defined and equal to stdout: stdin is
nonstandard (for ePAPR) and console in an unexpected place is after all
better than no console.

10 years agobump date forgotten in r257165
jmg [Sat, 26 Oct 2013 18:23:43 +0000 (18:23 +0000)]
bump date forgotten in r257165

10 years agoAdd some extra sanity checking and checks to printf format specifiers.
nwhitehorn [Sat, 26 Oct 2013 18:19:36 +0000 (18:19 +0000)]
Add some extra sanity checking and checks to printf format specifiers.

10 years agoProvide includes that are needed in these files, and before were read
glebius [Sat, 26 Oct 2013 18:18:50 +0000 (18:18 +0000)]
Provide includes that are needed in these files, and before were read
in implicitly via if.h -> if_var.h pollution.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoInterrelated improvements to early boot mappings:
nwhitehorn [Sat, 26 Oct 2013 18:18:14 +0000 (18:18 +0000)]
Interrelated improvements to early boot mappings:
- Remove explicit requirement that the SOC registers be found except as an
  optimization (although the MPC85XX LAW drivers still require they be found
  externally, which should change).
- Remove magic CCSRBAR_VA value.
- Allow bus_machdep.c's early-boot code to handle non 1:1 mappings and
  systems not in real-mode or global 1:1 maps in early boot.
- Allow pmap_mapdev() on Book-E to reissue previous addresses if the
  area is already mapped. Additionally have it check all mappings, not
  just the CCSR area.

This allows the console on e500 systems to actually work on systems where
the boot loader was not kind enough to set up a 1:1 mapping before starting
the kernel.

10 years agoThe r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
glebius [Sat, 26 Oct 2013 17:58:36 +0000 (17:58 +0000)]
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoClean up missed header references.
nwhitehorn [Sat, 26 Oct 2013 17:54:31 +0000 (17:54 +0000)]
Clean up missed header references.

10 years agoRemove unsigned < 0 comparison.
glebius [Sat, 26 Oct 2013 17:43:18 +0000 (17:43 +0000)]
Remove unsigned < 0 comparison.

10 years agoMove includes from if_bcereg.h to .c files.
glebius [Sat, 26 Oct 2013 17:40:38 +0000 (17:40 +0000)]
Move includes from if_bcereg.h to .c files.

10 years agoEnable SATA interface on Armada XP
zbb [Sat, 26 Oct 2013 17:29:50 +0000 (17:29 +0000)]
Enable SATA interface on Armada XP

- Add appropriate entry to DTS
- Allow for MV78460 SATA probe and configuration

Tested by: kevlo
Approved by: cognet (mentor)

10 years agoEnable UART busy detection handling for Armada XP - based board
zbb [Sat, 26 Oct 2013 17:27:32 +0000 (17:27 +0000)]
Enable UART busy detection handling for Armada XP - based board

All Armada XP chips should be affected. It is necessary to handle
busy interrupt/indication by enabling busy-detect property in DTS.

Tested by: kevlo
Approved by: cognet (mentor)

10 years agoWait for DesignWare UART transfers completion before accessing line control
zbb [Sat, 26 Oct 2013 17:24:59 +0000 (17:24 +0000)]
Wait for DesignWare UART transfers completion before accessing line control

When using DW UART with BUSY detection it is necessary to wait
until all serial transfers are finished before manipulating the
line control. LCR will not be affected when UART is busy.
In addition, if Divisor Latch Access Bit is being set in order to
modify UART divisors:
1. We will get BUSY interrupt if interrupts are enabled.
2. Because LCR will not be affected the THR and (even worse) IER
   contents will be corrupted. This will lead to console hang.

Approved by: cognet (mentor)

10 years agoFix concurrency issues with TLB1 updates and make pmap_kextract() search
nwhitehorn [Sat, 26 Oct 2013 16:49:41 +0000 (16:49 +0000)]
Fix concurrency issues with TLB1 updates and make pmap_kextract() search
TLB1 mappings as well, which is required for the console to work after
r257111.

10 years agoFix indentation
bdrewery [Sat, 26 Oct 2013 16:19:14 +0000 (16:19 +0000)]
Fix indentation

Reported by: zont
Approved by: bapt (implicit)
MFC after: 2 days
X-MFC-With: r257145

10 years agoSwitch to using ofw_bus_search_compatible() table-driven compat lookup.
ian [Sat, 26 Oct 2013 15:15:31 +0000 (15:15 +0000)]
Switch to using ofw_bus_search_compatible() table-driven compat lookup.
Add compat strings for Freescale Vybrid family SoCs.

10 years agoDocument that -a will output the device name when -u is not specified..
jmg [Sat, 26 Oct 2013 15:05:27 +0000 (15:05 +0000)]
Document that -a will output the device name when -u is not specified..
when -u is specified it is not...

update the docs to say that you can use full device names w/ -u, and
update the examples...

Submitted by: #vbsdcon
MFC after: 3 days

10 years agoAdd missing /etc/pkg to BSD.root.dist
bdrewery [Sat, 26 Oct 2013 15:02:34 +0000 (15:02 +0000)]
Add missing /etc/pkg to BSD.root.dist

Approved by: bapt
MFC after: 2 days
X-MFC-With: r257145

10 years agoThe old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs.
nwhitehorn [Sat, 26 Oct 2013 14:54:43 +0000 (14:54 +0000)]
The old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs.
Use it universally. Book-E traps may also need revisiting due to the
introduction of fixed-offset traps and the deprecation of IVORs in POWER
ISA 2.06, but that's very much an issue for another day.

10 years agoAdd pmap_mapdev_attr() and pmap_kenter_attr() interfaces. pmap_set_memattr()
nwhitehorn [Sat, 26 Oct 2013 14:52:55 +0000 (14:52 +0000)]
Add pmap_mapdev_attr() and pmap_kenter_attr() interfaces. pmap_set_memattr()
is slightly more complicated and is left unimplemented for now. Also
prevent pmap_mapdev() from mapping over the kernel and KVA regions if
devices happen to have high physical addresses.

MFC after: 2 weeks

10 years agoQueisce warnings for gperf -Wlogical-op-parentheses with parens to
sbruno [Sat, 26 Oct 2013 14:49:19 +0000 (14:49 +0000)]
Queisce warnings for gperf -Wlogical-op-parentheses with parens to
explicitly define the logic

10 years agoDisable fingerprint checking for now as the pkg repository mirrors will
bdrewery [Sat, 26 Oct 2013 14:19:57 +0000 (14:19 +0000)]
Disable fingerprint checking for now as the pkg repository mirrors will
not receive the signature until later this week.

Approved by: bapt

10 years agoLink in libcrypto as well to fix build in some cases.
bdrewery [Sat, 26 Oct 2013 13:38:49 +0000 (13:38 +0000)]
Link in libcrypto as well to fix build in some cases.

Approved by: bapt
MFC after: 2 days
Reported by: many

10 years agomachine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks to
nwhitehorn [Sat, 26 Oct 2013 13:18:39 +0000 (13:18 +0000)]
machine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks to
Alan Cox for pointing this out.

10 years agoMake hastctl list command output current queue sizes.
trociny [Sat, 26 Oct 2013 08:38:21 +0000 (08:38 +0000)]
Make hastctl list command output current queue sizes.

Reviewed by: pjd
MFC after: 1 month

10 years agoMerging local and remote bitmaps must be protected by hr_amp lock.
trociny [Sat, 26 Oct 2013 08:35:54 +0000 (08:35 +0000)]
Merging local and remote bitmaps must be protected by hr_amp lock.

This is believed to fix hastd crashes, which might occur during
synchronization, triggered by the failed assertion:

 Assertion failed: (amp->am_memtab[ext] > 0),
 function activemap_write_complete, file activemap.c, line 351.

MFC after: 1 week

10 years agoDo some cleanup of the SDT code. In particular,
markj [Sat, 26 Oct 2013 06:23:51 +0000 (06:23 +0000)]
Do some cleanup of the SDT code. In particular,

* Remove the unused sdt cdev.
* Don't bother keeping a list of probes in struct sdt_prov; it's not needed.
* Invoke sdt_load and sdt_unload from the module handler instead of
  registering separate SYSINITs.
* Keep to within 80 columns.
* Check for errors from dtrace_unregister().

10 years agoDocument /var/cache/pkg into hier(7) which pkg(8) uses.
bdrewery [Sat, 26 Oct 2013 03:55:29 +0000 (03:55 +0000)]
Document /var/cache/pkg into hier(7) which pkg(8) uses.

Approved by: bapt
MFC after: 2 days

10 years agoAdd infrastructure for installing pkg(8) keys into /etc/keys/pkg and add
bdrewery [Sat, 26 Oct 2013 03:53:24 +0000 (03:53 +0000)]
Add infrastructure for installing pkg(8) keys into /etc/keys/pkg and add
the current test key that packages will be signed with until 10.0-RELEASE.

Approved by: bapt
Discussed by: bapt with des
MFC after: 2 days

10 years agoAdd support to check the signature of a local pkg.txz file being
bdrewery [Sat, 26 Oct 2013 03:47:49 +0000 (03:47 +0000)]
Add support to check the signature of a local pkg.txz file being
added with "pkg add". If the pkg.conf is configured to check for
signature, then the pkg.txz.sig file will be expected and validated
per r257147

Approved by: bapt
MFC after: 2 days

10 years agoTell which fingerprint pkg is being validated against.
bdrewery [Sat, 26 Oct 2013 03:44:08 +0000 (03:44 +0000)]
Tell which fingerprint pkg is being validated against.

Approved by: bapt
MFC after: 2 days

10 years agoSupport checking signature for pkg bootstrap.
bdrewery [Sat, 26 Oct 2013 03:43:02 +0000 (03:43 +0000)]
Support checking signature for pkg bootstrap.

If the pkg.conf is configured with SIGNATURE_TYPE: FINGERPRINTS,
and FINGERPRINTS: /etc/keys/pkg then a pkg.sig file is fetched along
with pkg.txz. The signature contains the signature provided by the
signing server, and the public key. The .sig is the exact output
from the signing server in the following format:

  SIGNATURE
  <openssl signed>
  CERT
  <rsa public key>
  END

The signature is verified with the following logic:

 - If the .sig file is missing, it fails.
 - If the .sig doesn't validate, it fails.
 - If the public key in the .sig is not in the known trusted fingerprints,
   it fails.
 - If the public key is in the revoked key list, it fails.

Approved by: bapt
MFC after: 2 days
Discussed by: bapt with des, jonathan, gavin

10 years agoBe verbose and tell where pkg(8) is being bootstrapped from.
bdrewery [Sat, 26 Oct 2013 03:32:06 +0000 (03:32 +0000)]
Be verbose and tell where pkg(8) is being bootstrapped from.

Approved by: bapt
MFC after: 2 days

10 years agoAdd support for reading configuration files from /etc/pkg.
bdrewery [Sat, 26 Oct 2013 03:31:05 +0000 (03:31 +0000)]
Add support for reading configuration files from /etc/pkg.
For now only /etc/pkg/FreeBSD.conf is supported. Its style is:

Repo: {
   URL: "...",
   MIRROR_TYPE: "...",
   ...
}

The configuration will be read from /usr/local/etc/pkg.conf if exists,
otherwise /etc/pkg/FreeBSD.conf

Approved by: bapt
MFC after:  2 days

10 years agoFix build after r257111 by including headers with definition of pmap_kextract().
nwhitehorn [Sat, 26 Oct 2013 03:22:57 +0000 (03:22 +0000)]
Fix build after r257111 by including headers with definition of pmap_kextract().

10 years agoFix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction:
markj [Sat, 26 Oct 2013 03:21:54 +0000 (03:21 +0000)]
Fix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction:
the code was trying to save the stack pointer rather than the frame pointer,
and the arguments to copyout(9) were reversed, so nothing ended up being
saved on the stack. This would cause process crashes when the pid provider
was being used to instrument calls of a function starting with this
instruction.

Reported by: symbolics@gmx.com
Tested by: symbolics@gmx.com (earlier version)
MFC after: 2 weeks

10 years agoWrap long lines
bdrewery [Sat, 26 Oct 2013 03:21:08 +0000 (03:21 +0000)]
Wrap long lines

Approved by: bapt
MFC after: 2 days

10 years agoadd 0x8b, lifted from Linux iwlegacy/commands.h
adrian [Sat, 26 Oct 2013 01:17:54 +0000 (01:17 +0000)]
add 0x8b, lifted from Linux iwlegacy/commands.h

This is "STA invalid". I saw it during some 4965 testing (kern/183260)
and I still have no idea what is causing it.

Obtained from: Linux drivers/net/wireless/iwlegacy

10 years agoRegerate after r257138 swapped the default to WITH_NMTREE.
brooks [Fri, 25 Oct 2013 22:47:54 +0000 (22:47 +0000)]
Regerate after r257138 swapped the default to WITH_NMTREE.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoSwitch the default mtree to nmtree our new NetBSD derived mtree.
brooks [Fri, 25 Oct 2013 22:45:18 +0000 (22:45 +0000)]
Switch the default mtree to nmtree our new NetBSD derived mtree.

Exp-run by:     bdrewery
MFC after:      3 days
Sponsored by: DARPA/AFRL

10 years agovnet.h needs to be included before raw_cb.h. Now it compiles due to
glebius [Fri, 25 Oct 2013 19:49:03 +0000 (19:49 +0000)]
vnet.h needs to be included before raw_cb.h. Now it compiles due to
pollution via if_var.h.

10 years agoBegin fleshing out a knob to enable/disable bluetooth coexistence.
adrian [Fri, 25 Oct 2013 19:46:52 +0000 (19:46 +0000)]
Begin fleshing out a knob to enable/disable bluetooth coexistence.

Some firmware versions seem to get very unhappy if they're sent btcoex
commands when they don't actually have bluetooth hardware in them.
So, disable sending them those commands.

Tested:

* 5100 (which has bluetooth, no problems)
* 4965 (which doesn't have bluetooth, but didn't seem to crash)
* 6200 (no bluetooth, seems to get unhappy being sent bluetooth commands.)

10 years agoTemporarily disable multi-rate retry (link quality) and eliminate rate
adrian [Fri, 25 Oct 2013 19:44:53 +0000 (19:44 +0000)]
Temporarily disable multi-rate retry (link quality) and eliminate rate
index lookups.

* My recent(ish) change to iwn(4) and the net80211 rate control API to
  support 11n rates broke the link quality table use.  So, until I or
  someone else decides to fix it, let's just disable it for now.

* Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function.

* Eliminate two uses of the net80211 rate index lookup functions - they
  are only for legacy rates and they're not needed here.

This fixes some invalid looking rate control TX issues that showed up
on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look
like DMA related issues.

Tested:

* 4965, STA mode
* 5100, STA mode

10 years agoAdd id for GTM661W.
n_hibma [Fri, 25 Oct 2013 19:39:22 +0000 (19:39 +0000)]
Add id for GTM661W.

10 years agoReject attempts to attack a disk device that has the old NEEDSGIANT
jhb [Fri, 25 Oct 2013 19:19:12 +0000 (19:19 +0000)]
Reject attempts to attack a disk device that has the old NEEDSGIANT
flag set.

Reviewed by: mav

10 years agoAdd a helper routine to search for a compat string in a table that
ian [Fri, 25 Oct 2013 19:15:21 +0000 (19:15 +0000)]
Add a helper routine to search for a compat string in a table that
associates compat strings with arbitrary values that mean something to
the driver.  This is handy for drivers that support several variations
of similar hardware and need to know which one matched.

Reviewed by: imp, jmg, nwhitehorn

10 years agoRemove time and date stamps from svn* binaries, in order to make the
cperciva [Fri, 25 Oct 2013 18:43:53 +0000 (18:43 +0000)]
Remove time and date stamps from svn* binaries, in order to make the
builds reproducible.

Reviewed by: peter
MFC after: 3 days

10 years agoRemove all the instances of '#undef DEBUG' from kernel.
loos [Fri, 25 Oct 2013 18:38:44 +0000 (18:38 +0000)]
Remove all the instances of '#undef DEBUG' from kernel.

Suggested by: rpaulo
Approved by: adrian (mentor)

10 years agoMake sure to get the right node when looking up #interrupt-cells.
nwhitehorn [Fri, 25 Oct 2013 15:37:58 +0000 (15:37 +0000)]
Make sure to get the right node when looking up #interrupt-cells.

10 years agoConvert e500 PCI driver to use common PPC PCI bus glue. No functional
nwhitehorn [Fri, 25 Oct 2013 14:43:16 +0000 (14:43 +0000)]
Convert e500 PCI driver to use common PPC PCI bus glue. No functional
changes.

10 years agoRemove dead reference to PSL_MBO.
nwhitehorn [Fri, 25 Oct 2013 14:38:46 +0000 (14:38 +0000)]
Remove dead reference to PSL_MBO.

10 years agoRemove some #ifdef and duplication in the MSR bit definitions. This adds
nwhitehorn [Fri, 25 Oct 2013 14:37:15 +0000 (14:37 +0000)]
Remove some #ifdef and duplication in the MSR bit definitions. This adds
some security features to the Book-E kernel as well.

10 years agoUse common OFW root code to set up fdtbus. This is an almost purely
nwhitehorn [Fri, 25 Oct 2013 13:29:07 +0000 (13:29 +0000)]
Use common OFW root code to set up fdtbus. This is an almost purely
negative diff that should improve reliability somewhat. There should be
no differences in behavior -- please report any that crop up. This has been
tested on ARM and PPC systems.

Tested by: ray

10 years agoTest UARTs physical address instead of virtual.
ray [Fri, 25 Oct 2013 11:44:39 +0000 (11:44 +0000)]
Test UARTs physical address instead of virtual.

10 years agoAdd clang-CC and CC to list of hints allowing clang to identify its operating
smh [Fri, 25 Oct 2013 09:09:00 +0000 (09:09 +0000)]
Add clang-CC and CC to list of hints allowing clang to identify its operating
mode as c++ instead of defaulting to c for the binary names CC and clang-CC.

This fixes builds that use cmake, which automatically sets CXX to
/usr/bin/CC by default.

PR: bin/182442
Reviewed by: dwhite, wca
MFC after: 2 days

10 years agoDisable WITH_TESTS= for now.
rpaulo [Fri, 25 Oct 2013 06:37:43 +0000 (06:37 +0000)]
Disable WITH_TESTS= for now.

10 years agoAdd a tests(7) manual page.
rpaulo [Fri, 25 Oct 2013 05:33:04 +0000 (05:33 +0000)]
Add a tests(7) manual page.

This manual page intends to describe the structure and behavior of
the FreeBSD test suite installed in /usr/tests.  The contents have
been inherited from the NetBSD manual page.

As a side effect, this also updates the hier(7) manual page to
mention /usr/tests and points at tests(7) for more details.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoAdd missing plain.test.mk.
rpaulo [Fri, 25 Oct 2013 05:31:26 +0000 (05:31 +0000)]
Add missing plain.test.mk.

Submitted by: Julio Merino jmmv google.com
MFC after: 2 weeks

10 years agoAdd missing WITHOUT_TESTS file.
rpaulo [Fri, 25 Oct 2013 05:27:36 +0000 (05:27 +0000)]
Add missing WITHOUT_TESTS file.

Submitted by: Julio Merio jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoSet up the /usr/tests hierarchy.
rpaulo [Fri, 25 Oct 2013 05:25:19 +0000 (05:25 +0000)]
Set up the /usr/tests hierarchy.

Populate /usr/tests with the only test programs that currently live
in the tree (those in lib/libcrypt/tests/) and add all the build
machinery to accompany this change.

In particular:

- Add a WITHOUT_TESTS variable that users can define to request that
  no tests be put in /usr/tests.
- Add a top-level Kyuafile for /usr/tests and a way to create similar
  Kyuafiles in top-level subdirectories.
- Add a BSD.tests.dist file to define the directory layout of
  /usr/tests.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoMove the TESTSBASE definition to bsd.own.mk.
rpaulo [Fri, 25 Oct 2013 05:12:31 +0000 (05:12 +0000)]
Move the TESTSBASE definition to bsd.own.mk.

We need to be able to reference the value of TESTSBASE without requiring
the inclusion of bsd.test.mk (e.g. in etc/Makefile), so move its definition
to the more generic bsd.own.mk.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoAllow mixing bsd.files.mk with bsd.subdir.mk.
rpaulo [Fri, 25 Oct 2013 05:11:10 +0000 (05:11 +0000)]
Allow mixing bsd.files.mk with bsd.subdir.mk.

If a single Makefile wants to recurse into subdirectories and also
wants to install files, bsd.files.mk's targets would get ignored in
favor of those defined by bsd.subdir.mk because installfiles would
not get defined in bsd.files.mk.

Prevent this from happening by defining the targets in bsd.files.mk
with auxiliary names and listing them as dependencies of installfiles
instead.

This is required by bsd.test.mk, which needs to install a Kyuafile
in pretty much all cases but may also need to recurse into
subdirectories for build purposes.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

10 years agoAdd a configuration file and hints file for the Alfa Networks Hornet UB
adrian [Fri, 25 Oct 2013 04:06:54 +0000 (04:06 +0000)]
Add a configuration file and hints file for the Alfa Networks Hornet UB
board.

This is another AR9331 board similar to the Carambola2. It has different
ethernet and LED wiring though.

They make a variety of boards that mostly differ on the amount of RAM/flash
available.  Alfa Networks graciously donated a handful of 64MB RAM/16MB flash
boards so I can finish off 802.11s support for the AR93xx chips and do up
a tech demonstration with it.

This is enough to bring up the board.

Tested:

* Alfa networks UB Hornet board - 64MB ram, 16MB flash version.

Thankyou to Alfa Networks for the development boards!

Sponsored by: Alfa Networks (hardware only)

10 years agoBe a little more suspicious of thermal sensors, which can have single
nwhitehorn [Fri, 25 Oct 2013 03:55:52 +0000 (03:55 +0000)]
Be a little more suspicious of thermal sensors, which can have single
crazy readings occasionally. One wild reading should not be enough to
trigger a shutdown, so instead wait for several concerning readings in
a row.

PR: powerpc/180593
Submitted by: Julio Merino
MFC after: 1 week

10 years agoFix bug in the ioapic emulation for level-triggered interrupts,
grehan [Fri, 25 Oct 2013 03:18:56 +0000 (03:18 +0000)]
Fix bug in the ioapic emulation for level-triggered interrupts,
where a pin assertion while a source was masked would result in
the interrupt being lost, with the symptom being a console hang.
The condition is now recorded, and the interrupt generated when
the source is unmasked.

Discovered by: OpenBSD 5.4 MP
Reviewed by: neel
MFC after: 3 days

10 years agoQueisce quite a few clang warnings -Wdangling-else due to this work around
sbruno [Fri, 25 Oct 2013 01:10:07 +0000 (01:10 +0000)]
Queisce quite a few clang warnings -Wdangling-else due to this work around
for compiling gperf under Visual Studio from 1998.

ref. http://msdn.microsoft.com/en-us/library/b80153d8%28v=vs.90%29.aspx
ref. http://stackoverflow.com/questions/984878/what-is-the-possible-use-for-define-for-if-false-else-for

10 years agoInitialize inc_fibnum for properly handling ICMP6_PACKET_TOO_BIG errors
ae [Fri, 25 Oct 2013 01:02:25 +0000 (01:02 +0000)]
Initialize inc_fibnum for properly handling ICMP6_PACKET_TOO_BIG errors
in multifib environment.

PR: 183265
MFC after: 1 week