jhb [Wed, 12 Feb 2014 04:30:37 +0000 (04:30 +0000)]
Add support for managing PCI bus numbers. As with BARs and PCI-PCI bridge
I/O windows, the default is to preserve the firmware-assigned resources.
PCI bus numbers are only managed if NEW_PCIB is enabled and the architecture
defines a PCI_RES_BUS resource type.
- Add a helper API to create top-level PCI bus resource managers for each
PCI domain/segment. Host-PCI bridge drivers use this API to allocate
bus numbers from their associated domain.
- Change the PCI bus and CardBus drivers to allocate a bus resource for
their bus number from the parent PCI bridge device.
- Change the PCI-PCI and PCI-CardBus bridge drivers to allocate the
full range of bus numbers from secbus to subbus from their parent bridge.
The drivers also always program their primary bus register. The bridge
drivers also support growing their bus range by extending the bus resource
and updating subbus to match the larger range.
- Add support for managing PCI bus resources to the Host-PCI bridge drivers
used for amd64 and i386 (acpi_pcib, mptable_pcib, legacy_pcib, and qpi_pcib).
- Define a PCI_RES_BUS resource type for amd64 and i386.
imp [Wed, 12 Feb 2014 03:19:35 +0000 (03:19 +0000)]
Convert two while(1); statements into proper panics. Soon, kernels
with early printf support will print this info... For kernels without,
the observed behavior will be the same as it is now...
jmg [Wed, 12 Feb 2014 02:08:42 +0000 (02:08 +0000)]
add support for building a cross-gdb for ARM... This isn't hooked up
to xdev yet as I don't know how to make it work properly... It also
isn't heavily tested...
ian [Wed, 12 Feb 2014 00:53:38 +0000 (00:53 +0000)]
Rework the EARLY_PRINTF mechanism. Instead of defining a special eprintf()
routine, now a platform can provide a pointer to an early_putc() routine
which is used instead of cn_putc(). Control can be handed off from early
printf support to standard console support by NULLing out the pointer
during standard console init.
This leverages all the existing error reporting that uses printf calls,
such as panic() which can now be usefully employed even in early
platform init code (useful at least to those who maintain that code and
build kernels with EARLY_PRINTF defined).
jhb [Tue, 11 Feb 2014 22:05:21 +0000 (22:05 +0000)]
Correct assertion to assert that the existing device VM object uses the
same type rather than asserting in the case where we just created a new
VM object.
jhb [Tue, 11 Feb 2014 22:02:40 +0000 (22:02 +0000)]
Don't waste a page of KVA for the boot-time memory test on x86. For amd64,
reuse the first page of the crashdumpmap as CMAP1/CADDR1. For i386,
remove CMAP1/CADDR1 entirely and reuse CMAP3/CADDR3 for the memory test.
ian [Tue, 11 Feb 2014 21:13:37 +0000 (21:13 +0000)]
Check in the "real" board_tsc4370 file in place of the stubbed out one.
Real means the one TSC / Symmetricom / Microsemi actually uses on their 4370
and other rm9200 boards. This code demonstrates a variety of useful things
board init code can do, including adjusting the master clock frequency.
feld [Tue, 11 Feb 2014 15:38:29 +0000 (15:38 +0000)]
Add caveat to zpool manpage indicating that we do not automatically activate
hot spares. This should be MFC'd to all STABLE branches.
Upon the availability of zfsd, the zpool manpage on relevant branches should
be updated to remove this caveat and document hot spare's reliance on zfsd.
brueffer [Tue, 11 Feb 2014 15:16:49 +0000 (15:16 +0000)]
In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously
this could lead to the -n option effectively being ignored (in case
ac_line happened to be 0 aka SRC_AC), or other undefined behaviour.
PR: 169779
Submitted by: Alex Gonzalez <loox at e-shell.net>
Reviewed by: jhb
MFC after: 2 weeks
trasz [Tue, 11 Feb 2014 11:31:08 +0000 (11:31 +0000)]
Use "default" as default discovery-auth-group, instead of "no-access".
It doesn't change visible behaviour, as previously auth-group "default"
wasn't redefinable, so by default access was always denied.
trasz [Tue, 11 Feb 2014 11:29:05 +0000 (11:29 +0000)]
Add a new auth-group "default", defaulting to deny, and make it possible
to redefine it. From now on, assigning auth-group to a target is no longer
mandatory.
trasz [Tue, 11 Feb 2014 10:59:57 +0000 (10:59 +0000)]
Daemonize after applying configuration, not before, so that
any problems - including "daemon already running" - are visible
on the terminal and not just in logs.
trasz [Tue, 11 Feb 2014 10:58:32 +0000 (10:58 +0000)]
Empty data segment during Login Phase is rather unlikely, but it's
not, by itself, a protocol error. This fixes interoperability with
OpenBSD initiator.
melifaro [Mon, 10 Feb 2014 12:52:33 +0000 (12:52 +0000)]
Simplify nd6_output_lle:
* Check ND6_IFF_IFDISABLED before acquiring any locks
* Assume m is always non-NULL
* remove 'bad' case not used anymore
* Simply if_output conditional
ian [Sun, 9 Feb 2014 21:21:10 +0000 (21:21 +0000)]
If someone tries to boot a generic ATMEL kernel that has no board_init()
routine compiled in, print a friendly error message about it rather than
mysteriously hanging while trying to init 4GB of nonexistant ram.
dim [Sun, 9 Feb 2014 20:52:47 +0000 (20:52 +0000)]
Pull in r200899 from upstream clang trunk:
Allow transformation of VariableArray to ConstantArray.
In the following code:
struct A { static const int sz; };
template<class T> void f() { T arr[A::sz]; }
the array 'arr' is represented as a variable size array in the template.
If 'A::sz' gets value below in the translation unit, the array in
instantiation can turn into constant size array.
ian [Sun, 9 Feb 2014 02:39:00 +0000 (02:39 +0000)]
It turns out a global variable is the only straightforward way to
communicate the kernel's physical load address from where it's known in
initarm() into cpu_mp_start() which is called from non-arm code and
takes no parameters.
This adds the global variable and ensures that all the various copies
of initarm() set it. It uses the variable in cpu_mp_start(), eliminating
the last uses of KERNPHYSADDR outside of locore.S (where we can now
calculate it instead of relying on the constant).
ian [Sun, 9 Feb 2014 01:21:30 +0000 (01:21 +0000)]
Replace compile-time constant KERNPHYSADDR with abp_physaddr (determined
at runtime) where it's trivial to do so. Another breadcrumb on the trail
to a kernel that can be loaded at any 1MB boundary.
ian [Sat, 8 Feb 2014 23:54:16 +0000 (23:54 +0000)]
Consolidate code related to setting up physical memory configuration into
a new physmem.c file. The new code provides helper routines that can be
used by legacy SoCs and newer FDT-based systems. There are routines to
add one or more regions of physically contiguous ram, and exclude one or
more physically contiguous regions of ram. Ram can be excluded from crash
dumps, from being given over to the vm system for allocation management,
or both. After all the included and excluded regions have been added,
arm_physmem_init_kernel_globals() processes the regions into the global
dump_avail and phys_avail arrays and realmem and physmem variables that
communicate memory configuration to the rest of the kernel.
Convert all existing SoCs to use the new helper code.
ian [Sat, 8 Feb 2014 22:21:38 +0000 (22:21 +0000)]
Remove the ARM_USE_SMALL_ALLOC option and code related to it.
This was an optimization used only by a few xscale platforms. Part of
the optimization was to create a direct map for all physical pages, and
that resulted in making multiple mappings of pages in a way that bypassed
the logic in pmap.c to handle VIVT cache aliasing. It also just generally
made the code more complex and hard to maintain for all SoCs.
jhb [Sat, 8 Feb 2014 16:37:54 +0000 (16:37 +0000)]
Add virtualized XSAVE support to bhyve which permits guests to use XSAVE and
XSAVE-enabled features like AVX.
- Store a per-cpu guest xcr0 register. When switching to the guest FPU
state, switch to the guest xcr0 value. Note that the guest FPU state is
saved and restored using the host's xcr0 value and xcr0 is saved/restored
"inside" of saving/restoring the guest FPU state.
- Handle VM exits for the xsetbv instruction by updating the guest xcr0.
- Expose the XSAVE feature to the guest only if the host has enabled XSAVE,
and only advertise XSAVE features enabled by the host to the guest.
This ensures that the guest will only adjust FPU state that is a subset
of the guest FPU state saved and restored by the host.
jilles [Sat, 8 Feb 2014 13:51:15 +0000 (13:51 +0000)]
init: Remove code to track line numbers in /etc/ttys.
The tracking generated warnings when the line number of an existing tty in
/etc/ttys changed, which would corrupt utmp (as it was indexed by the line
number). With utmpx, the line number no longer matters, so the tracking is
no longer needed.
delphij [Sat, 8 Feb 2014 05:35:36 +0000 (05:35 +0000)]
MFV r261619:
4574 get_clones_stat does not call zap_count in non-debug kernel
zap_count(...) is never called in non-DEBUG kernel.
As result "count" variable is always 0, and "goto fail" is always
reached. This means get_clones_stat function never makes up list
of clones for "clones" properties.
delphij [Sat, 8 Feb 2014 05:17:49 +0000 (05:17 +0000)]
In g_eli_crypto_hmac_init(), zero out after using the ipad buffer,
k_ipad.
Note that the two consumers in geli(4) are not affected by this
issue because the way the code is constructed and as such, we
believe there is no security impact with or without this change
with geli(4)'s usage.
Reported by: Serge van den Boom <serge vdboom.org>
Reviewed by: pjd
MFC after: 2 weeks
neel [Sat, 8 Feb 2014 05:04:34 +0000 (05:04 +0000)]
Fix a bug in the handling of VM-exits caused by non-maskable interrupts (NMI).
If a VM-exit is caused by an NMI then "blocking by NMI" is in effect on the
CPU when the VM-exit is completed. No more NMIs will be recognized until
the execution of an "iret".
Prior to this change the NMI handler was dispatched via a software interrupt
with interrupts enabled. This meant that an interrupt could be recognized
by the processor before the NMI handler completed its execution. The "iret"
issued by the interrupt handler would then cause the "blocking by NMI" to
be cleared prematurely.
This is now fixed by handling the NMI with interrupts disabled in addition
to "blocking by NMI" already established by the VM-exit.
asomers [Sat, 8 Feb 2014 00:20:21 +0000 (00:20 +0000)]
tests/sys/Makefile
use TESTS_SUBDIRS for kern instead of SUBDIRS. I don't think it
makes a difference in this case, but TESTS_SUBDIRS is generally
correct for subdirectories that contain tests.
Sponsored by: Spectra Logic
MFC after: 5 days
X-MFC-With: r261133