glebius [Sun, 29 Dec 2013 18:34:29 +0000 (18:34 +0000)]
Fix the parse type for NGM_LISTTYPES.
Actually, text versions of generic commands are not used, since ngctl(8)
uses binary messages for them. And to request a text command one needs
a working ngctl(8). That's why the bug was never discovered. I'm pondering
on removing the text support for generic commands.
marius [Sun, 29 Dec 2013 17:43:37 +0000 (17:43 +0000)]
- Simplify MSI allocation and release. For a single one, we don't need to
fiddle with the MSI count and pci_release_msi(9) is smart enough to just
do nothing in case of INTx.
- Don't allocate MSI as RF_SHAREABLE.
marius [Sun, 29 Dec 2013 17:37:32 +0000 (17:37 +0000)]
Free the MSI again on detach if allocated. Arguably, this code would be
better off living in aac_pci.c, but it doesn't seem worth creating a
aac_pci_detach() and it's also not the first PCI-specific bit in aac.c
markj [Sun, 29 Dec 2013 17:08:30 +0000 (17:08 +0000)]
The arguments to sched:::off-cpu are the thread and associated process of
the thread selected to run, not the currently running thread. This fix has
already been made for ULE in r252070.
marius [Sun, 29 Dec 2013 16:43:35 +0000 (16:43 +0000)]
Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number,
i. e. the POSIX:5.6.1 st_ino field, which can be used to detect hard links
in the file system. This is also the default in mkisofs(8) and according to
its man page, no system only being able to cope with Rock Ridge version 1.10
is known to exist.
PR: 185138
Submitted by: Kurt Lidl
MFC after: 1 week
dim [Sun, 29 Dec 2013 16:28:37 +0000 (16:28 +0000)]
In sys/dev/mcd/mcd.c, mark the static const COPYRIGHT string as __used,
so it ends up in the object file, and no warnings are emitted about it
being actually unused.
mav [Sun, 29 Dec 2013 11:19:09 +0000 (11:19 +0000)]
Introduce xprt_inactive_self() -- variant for use when sure that port
is assigned to thread. For example, withing receive handlers. In that
case the function reduces to single assignment and can avoid locking.
marcel [Sun, 29 Dec 2013 02:31:40 +0000 (02:31 +0000)]
Add support for virtual cores (aka minidumps). To that end, refactor this
file as follows:
1. Common ia64-specific support functions have the ia64_ prefix.
2. Functions that work on physical cores have the phys_ prefix.
3. Functions that work on virtual cores have the virt_ prefix.
With that:
1. _kvm_kvatop() has been renamed to phys_kvatop() as it handles
physical cores only.
2. The new _kvm_kvatop() is nothing but a wrapper that calls either
phys_kvatop() or virt_kvatop() by virtue of the kvatop function
pointer in the vmstate structure.
3. virt_kvatop() is nothing but a wrapper around virt_addr2off().
4. virt_addr2off() iterates over the Phdrs to find the segment in
which the address falls and return the file offset for it.
Now it's up to the kernel to populate the core file appropriately.
marcel [Sat, 28 Dec 2013 23:01:57 +0000 (23:01 +0000)]
Allow building a cross libkvm by setting TARGET_ARCH. The library so
produced will be called libkvm-${ARCH} instead of libkvm. This allows
installing it alongside the native version.
For symbol lookups, use ps_pglobal_lookup() instead of __fdnlist()
when building a cross libkvm. It is assumed that the cross tool that
uses the cross libkvm also provides an implementation for this
proc_services function.
Note that this commit does not change any of the architecture-specific
code for cross-compilation.
dim [Sat, 28 Dec 2013 22:44:02 +0000 (22:44 +0000)]
For sys/dev/drm2/radeon, only use -fms-extensions with gcc. This flag
is only to stop gcc complaining about anonymous unions, which clang does
not do. For clang 3.4 however, -fms-extensions enables the Microsoft
__wchar_t type, which clashes with our own types.h.
dim [Sat, 28 Dec 2013 20:54:08 +0000 (20:54 +0000)]
In libc++'s type_traits header, avoid warnings (activated by our use of
-Wsystem-headers) about potential keyword compatibility problems, by
adding a __libcpp prefix to the applicable identifiers.
Upstream is still debating about this, but we need it now, to be able to
import clang 3.4.
pfg [Sat, 28 Dec 2013 20:30:31 +0000 (20:30 +0000)]
gcc: Add support for label attributes and "unavailable" attribute.
Apple GCC has extensions to support for both label attributes and
an "unavailable" attribute. These are critical for objc but are
also useful in regular C/C++.
Apparently at least the label attributes might have found their way to
upstream GCC but the code doesn't seem available on the GPLv2 tree so
we are taking the code directly from Apple. To make this clearer we
are preserving the annoying "APPLE LOCAL" tags and the ChangeLogs
when they are available.
marcel [Sat, 28 Dec 2013 19:54:19 +0000 (19:54 +0000)]
Add a virt_foreach() that does the same as what phys_foreach() does and
change virt_size(), virt_dumphdrs() and virt_dumpdata() into its callback
functions.
In virt_foreach() we iterate over all the virtual memory regions that we
want in the minidump. For now, just start with the PBVM (= kernel text
and data plus preloaded modules). The core file this produces can already
be used to work out the libkvm changes that need to be made to support it.
In parallel, we can flesh out the in-kernel bits to dump more of what we
need in a minidump without changing the core file structure.
alc [Sat, 28 Dec 2013 04:28:35 +0000 (04:28 +0000)]
MFp4 alc_popmap
Change the way that reservations keep track of which pages are in use.
Instead of using the page's PG_CACHED and PG_FREE flags, maintain a bit
vector within the reservation. This approach has a couple benefits.
First, it makes breaking reservations much cheaper because there are
fewer cache misses to identify the unused pages. Second, it is a pre-
requisite for supporting two or more reservation sizes.
jhb [Sat, 28 Dec 2013 04:01:05 +0000 (04:01 +0000)]
Extend the ACPI power management support to wire a virtual power button up
to SIGTERM when ACPI is enabled. Sending SIGTERM to the hypervisor when an
ACPI-aware OS is running will now trigger a soft-off allowing for a graceful
shutdown of the guest.
- Move constants for ACPI-related registers to acpi.h.
- Implement an SMI_CMD register with commands to enable and disable ACPI.
Currently the only change when ACPI is enabled is to enable the virtual
power button via SIGTERM.
- Implement a fixed-feature power button when ACPI is enabled by asserting
PWRBTN_STS in PM1_EVT when SIGTERM is received.
- Add support for EVFILT_SIGNAL events to mevent.
- Implement support for the ACPI system command interrupt (SCI) and assert
it when needed based on the values in PM1_EVT. Mark the SCI as active-low
and level triggered in the MADT and MP Table.
- Mark PCI interrupts in the MP Table as active-low in addition to level
triggered.
neel [Sat, 28 Dec 2013 00:20:55 +0000 (00:20 +0000)]
Modify handling of writes to the vlapic LVT registers.
The handler is now called after the register value is updated in the virtual
APIC page. This will make it easier to handle APIC-write VM-exits with APIC
register virtualization turned on.
This also implies that we need to keep a snapshot of the last value written
to a LVT register. We can no longer rely on the LVT registers in the APIC
page to be "clean" because the guest can write anything to it before the
hypervisor has had a chance to sanitize it.
delphij [Fri, 27 Dec 2013 23:06:15 +0000 (23:06 +0000)]
Tighten default restrictions for ntpd(8) server and provide a link
to NTP access restriction documentation.
The new default restrictions would allow only time queries from a
remote system and will KoD all other requests, but still allow
localhost to do make all requests.
These restrictions are also recommended for all Internet-facing
public NTP servers.
This changeset is intended for an instant MFC to stable/10 and
releng/10.0.
neel [Fri, 27 Dec 2013 20:18:19 +0000 (20:18 +0000)]
Modify handling of writes to the vlapic ICR_TIMER, DCR_TIMER, ICRLO and ESR
registers.
The handler is now called after the register value is updated in the virtual
APIC page. This will make it easier to handle APIC-write VM-exits with APIC
register virtualization turned on.
We can no longer rely on the value of 'icr_timer' on the APIC page
in the callout handler. With APIC register virtualization the value of
'icr_timer' will be updated by the processor in guest-context before an
APIC-write VM-exit.
Clear the 'delivery status' bit in the ICRLO register in the write handler.
With APIC register virtualization the write happens in guest-context and
we cannot prevent a (buggy) guest from setting this bit.
marcel [Fri, 27 Dec 2013 19:51:17 +0000 (19:51 +0000)]
Add the scaffolding for minidumps. They're just like physical dumps,
except the chunks aren't physical memory regions but virtual memory
regions. In both cases, the core file is an ELF file and flags in
the header allow libkvm to distinguish one from the other.
kib [Fri, 27 Dec 2013 17:09:59 +0000 (17:09 +0000)]
Fix accounting for the negative cache entries when reusing v_cache_dd.
Having ncneg diverge with the actual length of the ncneg tailq causes
NULL dereference.
Add assertion that an entry taken from ncneg queue is indeed negative.
Reported by and discussed with: avg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
kib [Fri, 27 Dec 2013 16:59:47 +0000 (16:59 +0000)]
Do not coalesce stack entry, vm_map_stack() asserts that the requested
region is claimed by a new entry.
Pass MAP_STACK_GROWS_DOWN and MAP_STACK_GROWS_UP flags to
vm_map_insert() from vm_map_stack(), to really turn off coalescing
code and call to vm_map_simplify_entry() [1].
Reported by: avg, peter, many
Tested by: avg, peter
Noted by: avg [1]
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
pluknet [Fri, 27 Dec 2013 16:57:38 +0000 (16:57 +0000)]
- Fix EBADF description, in following the future POSIX tc and what FreeBSD
actually implements.
- Improve grammar: use more preferred "can", not "could".
jilles [Fri, 27 Dec 2013 15:52:18 +0000 (15:52 +0000)]
sh: Don't check input for non-whitespace if history is disabled.
preadbuffer() maintained a flag whether there was any non-whitespace
character. This flag is only useful when history is enabled (in that case,
lines containing only whitespace are not added to history). Instead, check
using strspn() when history is enabled.
There is an approximate 2% speedup when running
sh -c '. /etc/rc.subr; . /etc/defaults/rc.conf; source_rc_confs'
with hot cache.
neel [Fri, 27 Dec 2013 07:01:42 +0000 (07:01 +0000)]
Modify handling of write to the vlapic SVR register.
The handler is now called after the register value is updated in the virtual
APIC page. This will make it easier to handle APIC-write VM-exits with APIC
register virtualization turned on.
Additionally, mask all the LVT entries when the vlapic is software-disabled.
ae [Fri, 27 Dec 2013 02:43:53 +0000 (02:43 +0000)]
Add an ability to stop gmirror and clear its metadata in one command.
This fixes the problem, when gmirror starts again just after stop.
The problem occurs when gmirror's component has geom label with equal size.
E.g. gpt and gptid have the same size as partition, diskid has the same
size as entire disk. When gmirror's geom has been destroyed, glabel
creates its providers and this initiate retaste.
Now "gmirror destroy" command is available. It destroys geom and also
erases gmirror's metadata.
neel [Thu, 26 Dec 2013 19:58:30 +0000 (19:58 +0000)]
Modify handling of writes to the vlapic ID, LDR and DFR registers.
The handlers are now called after the register value is updated in the virtual
APIC page. This will make it easier to handle APIC-write VM-exits with APIC
register virtualization turned on.
Additionally, we need to ensure that the value of these registers is always
correctly reflected in the virtual APIC page, because there is no VM exit
when the guest reads these registers with APIC register virtualization.
bz [Thu, 26 Dec 2013 15:51:14 +0000 (15:51 +0000)]
Use feature_present(3) to determine whether to open an INET or an
INET6 socket when needed to allow pfctl to work on noinet and noinet6
kernels (and try to provide a fallback using AF_LINK as best effort).
Adjust the Makefile to also respect relevant src.conf(5) options
for compile time decisions on INET and INET6 support.
Reviewed by: glebius (no objections)
MFC after: 1 week
marcel [Thu, 26 Dec 2013 07:10:54 +0000 (07:10 +0000)]
Fix "kptdir is itself virtual" error, caused by having the kptdir in PBVM.
While here improve errors by having them include addresses (either virtual
or physical).
marcel [Thu, 26 Dec 2013 05:46:10 +0000 (05:46 +0000)]
For ia64, use pmap_remove_pages() and not pmap_remove(). The problem is
that we don't have a good way (yet) to iterate over the mapped pages by
virtual address and simply try each page within the range. Given that we
call pmap_remove() over the entire 2^63 bytes of address space, it takes
a while for pmap_remove to have tried all 2^50 pages.
By using pmap_remove_pages() we use the PV list to find all mappings.
luigi [Thu, 26 Dec 2013 05:22:38 +0000 (05:22 +0000)]
use the correct netmap <-> nic slot mapping on the transmit ring for 'lem'.
This bug would manifest only in netmap mode and on packets transmitted after
a NIC reset while netmap mode is active.
dim [Thu, 26 Dec 2013 00:11:19 +0000 (00:11 +0000)]
In sys/dev/drm/mach64_dma.c, remove static function mach64_set_dma_eol(),
which has never been used, even by upstream, since its initial upstream
commit (see http://cgit.freedesktop.org/mesa/drm/commit/?id=873e1c4d )
dim [Wed, 25 Dec 2013 22:49:54 +0000 (22:49 +0000)]
In sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c, remove static functions
mk_cpl_barrier_ulp(), mk_get_tcb_ulp() and mk_set_tcb_field_ulp(), which
are all unused since r237263.
dim [Wed, 25 Dec 2013 22:32:34 +0000 (22:32 +0000)]
In sys/vm/vm_pageout.c, since vm_pageout_worker() takes a void * as
argument, cast the incoming 0 argument to void *, to silence a warning
from clang 3.4 ("expression which evaluates to zero treated as a null
pointer constant of type 'void *' [-Wnon-literal-null-conversion]").
bz [Wed, 25 Dec 2013 20:26:49 +0000 (20:26 +0000)]
Add more (IPv6) related Internet Protocols:
- Host Identity Protocol (RFC5201)
- Shim6 Protocol (RFC5533)
- 2x experimentation and testing (RFC3692, RFC4727)
This does not indicate interest to implement/support these protocols,
but they are part of the "IPv6 Extension Header Types" [1] based on RFC7045
and might thus be needed by filtering and next header parsing
implementations.
bz [Wed, 25 Dec 2013 20:15:48 +0000 (20:15 +0000)]
Bite the bullet and start removing the first compile time warnings
by removing unsued file local functions and then unused callees.
A lot more warnings to resolve but someone had to break the ice.
MFC after: 10 days
X-Comment: I am not the new maintainer; chime in, it's ours.
bz [Wed, 25 Dec 2013 20:08:44 +0000 (20:08 +0000)]
Correct warnings comparing unsigned variables < 0 constantly reported
while building kernels. All instances removed are indeed unsigned so
the expressions could not be true.
jmmv [Wed, 25 Dec 2013 18:25:58 +0000 (18:25 +0000)]
Put the release objdir inside the chroot.
When building the system from outside the chroot as part of the release
process, ensure the objdir is within the chroot so that the whole output
of the release.sh script is self-contained in a single directory.
Use CHROOTDIR/tmp/obj instead of CHROOTDIR/usr/obj to minimize possible
interferences with the output of the build itself.
mav [Wed, 25 Dec 2013 16:58:42 +0000 (16:58 +0000)]
Slightly simplify expiration logic introduced in r254337.
- Do not update the histogram for items we are any way deleting from cache.
- Do not update the histogram if nfsrc_tcphighwater is not set.
- Remove some extra math operations.
pluknet [Wed, 25 Dec 2013 16:01:29 +0000 (16:01 +0000)]
The compile time constant limit on number of swap devices was removed in 5.2.
As such, remove the EINVAL error saying so. Currently the vm.nswapdev sysctl
just represents the number of added swap devices.
jmmv [Wed, 25 Dec 2013 13:57:23 +0000 (13:57 +0000)]
Delay copying of resolv.conf into the chroot until /etc exists.
With an unpopulated chroot dir, release building was failing because
the script was attempting to copy resolv.conf into a non-existent /etc
directory of the chroot. Fix this by copying the file only after the
installworld has happened, which will create this directory.