Svatopluk Kraus [Wed, 17 Feb 2016 12:36:24 +0000 (12:36 +0000)]
Remove pd_prot and pd_cache members from struct arm_devmap_entry.
The struct is used for definition of static device mappings which
should always have same protection and attributes.
Svatopluk Kraus [Wed, 17 Feb 2016 12:30:59 +0000 (12:30 +0000)]
Evaluate also VM_PROT_EXECUTE protection in pmap_preboot_map_attr().
Before this change all mappings done by this function were executable
as pte entries have NOT EXECUTABLE bit.
The function is used only for static device mappings at present. Thus
this is also a fix as DEVICE memory should not be mapped as executable.
John Baldwin [Tue, 16 Feb 2016 22:00:01 +0000 (22:00 +0000)]
Fetch the current thread and it's syscall state from the trussinfo object
instead of passing some of that state as arguments to print_syscall() and
print_syscallret(). This just makes the calls of these functions shorter
and easier to read.
John Baldwin [Tue, 16 Feb 2016 21:42:53 +0000 (21:42 +0000)]
The locking annotations for struct sockbuf originally used the key from
struct socket. When sockbuf.h was moved out of socketvar.h, the locking
key was no longer nearby. Instead, add a new key for sockbuf and use
a single item for the socket buffer lock instead of separate entries for
receive vs send buffers.
Reviewed by: adrian
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4901
Bryan Drewery [Tue, 16 Feb 2016 16:07:12 +0000 (16:07 +0000)]
Revert r295648 for now.
This builds fine with FAST_DEPEND but the mkdep method requires that
include/ generates the headers during 'make depend' so the subsequent
directories can find them when running mkdep.
Andrew Turner [Tue, 16 Feb 2016 15:18:12 +0000 (15:18 +0000)]
Allow callers of OF_decode_addr to get the size of the found mapping. This
will allow for code that uses the old fdt_get_range and fdt_regsize
functions to find a range, map it, access, then unmap to replace this, up
to and including the map, with a call to OF_decode_addr.
As this function should only be used in the early boot code the unmap is
mostly do document we no longer need the mapping as it's a no-op, at least
on arm.
Ed Maste [Tue, 16 Feb 2016 14:03:25 +0000 (14:03 +0000)]
Allow elfcopy to convert between two non-ELF formats
If the output object is not an ELF file, choose an arbitrary ELF format
for the intermediate file. srec, ihex and binary formats are independent
of class, endianness and machine type so these choices do not affect the
output.
ELF Tool Chain ticket #517
Reviewed by: kai
Obtained from: ELF Tool Chain r3411
Svatopluk Kraus [Tue, 16 Feb 2016 13:40:23 +0000 (13:40 +0000)]
Use EARLY_DRIVER_MODULE() for ti_scm driver to be attached before
am335x_prcm driver which uses it. Used BUS_PASS_BUS is a quick pick
for now and may be revised when other drivers start using multipass
feature.
This is needed after an update of Linux dts files done in r295436.
Svatopluk Kraus [Tue, 16 Feb 2016 12:19:06 +0000 (12:19 +0000)]
Do not use DMA channels used by GPU.
(1) The channel mask is get from "brcm,dma-channel-mask" property of
dma node, and if not provided, from "broadcom,channels" property.
(2) Consequently, sdhci driver does not allocate any specific channel.
(3) Use CS_RESET bit for initial channel reset.
Andrew Turner [Tue, 16 Feb 2016 11:45:46 +0000 (11:45 +0000)]
Add an analog audio driver for the audio codec found on the Allwinner
A10/A20 SoC. Based loosely on the submitters NetBSD driver, tested on
Cubieboard 2. Playback and capture are supported.
Submitted by: Jared McNeill <jmcneill@invisible.ca>
Differential Revision: https://reviews.freebsd.org/D5202
Zbigniew Bodek [Tue, 16 Feb 2016 11:43:57 +0000 (11:43 +0000)]
Support PEM that is not a PCI endpoint on ThunderX
Some chip revisions don't have their external PCIe buses
behind the internal bridge. Add support for FDT-configurable
PEMs but keep ability for PCIe enumeration.
John Baldwin [Mon, 15 Feb 2016 20:26:40 +0000 (20:26 +0000)]
Sign extend the error value for failing Linux/i386 system calls. This
restores the mapping of Linux errors to native FreeBSD errno values after
the refactoring in r288424.
Pedro F. Giffuni [Mon, 15 Feb 2016 18:13:33 +0000 (18:13 +0000)]
fputs: Return the number of bytes written.
POSIX.1-2008 requires that successful completion simply return a
non-negative integer. We have regularly returned a constant value.
Another, equally valid, implementation convention implies returning
the number of bytes written.
Adopt this last convention to be in line with what Apple's libc
does. POSIX also explicitly notes:
Note that this implementation convention cannot be adhered to for strings
longer than {INT_MAX} bytes as the value would not be representable in the
return type of the function. For backwards-compatibility, implementations
can return the number of bytes for strings of up to {INT_MAX} bytes, and
return {INT_MAX} for all longer strings.
Developers shouldn't depend specifically on either convention but
the change may help port software from Apple.
Differential Revision: https://reviews.freebsd.org/D442 (Partial)
Obtained from: Apple Inc. (Libc 997.90.3 with changes)
Relnotes: yes
Svatopluk Kraus [Mon, 15 Feb 2016 15:28:56 +0000 (15:28 +0000)]
Initial OMAP4 WUGEN pass-through driver. SPI interrupts are passed
through WUGEN to GIC. Hardware initialization is left in state after
reset as well as before.
This is needed after an update of Linux dts files.
Andrew Turner [Mon, 15 Feb 2016 15:11:26 +0000 (15:11 +0000)]
Add support for the Allwinner i2c device. This is similar to the existing
Marvell twsi part, however uses different register locations, as such split
the existing driver into Marvell and Allwinner attachments.
Adrian Chadd [Mon, 15 Feb 2016 14:34:35 +0000 (14:34 +0000)]
Allow MIPS INTRNG code to be built without FDT support.
This patch allows the newly imported INTRNG code to be built without necessarily
having FDT support in the kernel. This may be useful for some MIPS platforms
that wish to move to INTRNG, but not to FDT at the same time.
Basically all the code is already within ifdef's where FDT is concerned,
it's just the headers that aren't.
Submitted by: Stanislav Galabov <sgalabov@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5249
Andrew Turner [Sun, 14 Feb 2016 23:51:13 +0000 (23:51 +0000)]
Move the twsi driver source to be under iicbus. It is in a separate
directory as it is expected multiple attachments will be added for the SoC
families that use this hardware.
Conrad Meyer [Sun, 14 Feb 2016 22:37:28 +0000 (22:37 +0000)]
NTB: workaround for high traffic hardware hang
This patch comes from Dave Jiang's Linux tree, davejiang/ntb. It hasn't
been accepted into Linus' tree, so I do not have an authoritative SHA1
to point at. Original commit log:
=====================================================================
A hardware errata causes the NTB to hang when heavy bi-directional
traffic in addition to the usage of BAR0/1 (where the registers reside,
including the doorbell registers to trigger interrupts).
This workaround is only available on Haswell and Broadwell platform.
The workaround is to enable split BAR in the BIOS to allow the 64bit
BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed
to LAPIC region of the remote host. We will bypass the db mechanism and
directly trigger the MSIX interrupts. The offsets and vectors are
exchanged during transport scratch pad negotiation. The scratch pads are
now overloaded in order to allow the exchange of the information. This
gets around using the doorbell and prevents the lockup with additional
pcode changes in BIOS.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
=====================================================================
Notable changes in the FreeBSD version of this patch:
* The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx).
The Linux version of the patch only uses BAR4.
* MSIX negotiation aborts if the link goes down.
Pedro F. Giffuni [Sun, 14 Feb 2016 19:52:50 +0000 (19:52 +0000)]
ext2fs: Remove panics for rename() race conditions.
Sync with r84642 from UFS:
The panics are inappropriate because the IN_RENAME flag only fixes a
few of the huge number of race conditions that can result in the
source path becoming invalid even prior to the VOP_RENAME() call.
Found accidentally while checking an issue from PVS Static Analysis.
Hide ucontext_t and mcontext_t when neither POSIX nor XSI features are
enabled in the compilation environment, i.e. for ANSI C use of
#include <signal.h>.
Requested and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 13 days
Devin Teske [Sat, 13 Feb 2016 00:28:48 +0000 (00:28 +0000)]
Fix missing description for command usage
While "jng" or "jib" without arguments told you what each sub-command does,
sub-command usage didn't tell you (e.g., "jng bridge" or "jib addm" gave
only usage and not description).
Ed Maste [Fri, 12 Feb 2016 20:54:02 +0000 (20:54 +0000)]
Update ELF Tool Chain to upstream rev 3400
Some notable improvements include:
readelf:
- Add AArch64 relocation definitions.
- Report value of unknown relocation types.
elfcopy:
- Consider symbols with STB_GNU_UNIQUE binding as global symbols.
- Fixed support for VMA adjustment for loadable sections found
in relocatable objects.
- Handle nameless global symbols.
- Improve wildcard matching for !-prefixed symbols.
- Add PE/COFF support.
Mark Johnston [Fri, 12 Feb 2016 20:43:53 +0000 (20:43 +0000)]
Clear the cookie pointer on error in tmpfs_readdir().
It is otherwise left dangling, and callers that request cookies always free
the cookie buffer, even when VOP_READDIR(9) returns an error. This results
in a double free if tmpfs_readdir() returns an error to the NFS server or
the Linux getdents(2) emulation code.
Andrew Turner [Fri, 12 Feb 2016 12:38:04 +0000 (12:38 +0000)]
Only update curthread and curpcb after we have finished using the old
values.
If switching from a thread that used floating-point registers to a thread
that is still running, but holding the blocked_lock lock we would switch
the curthread to the new (running) thread, then call critical_enter. This
will non-atomically increment td_critnest, and later call critical_exit to
non-atomically decrement this value.
This can happen at the same time as the new thread is still running on the
old core, also calling these functions. In this case there will be a race
between these non-atomic operations. This can be an issue as we could loose
one of these operations leading to the value to not return to zero.
If, later on, we then hit a data abort we check if the td_critnest is zero.
If this check fails we will panic the kernel.
This has been observed when running pcmstat on a Cavium ThunderX. The pcm
thread will use the blocked_lock lock and there is a high chance userspace
will use the floating-point registers. When, later on, pmcstat triggers a
data abort we will hit this panic.
The fix is to update these values after storing the floating-point state.
This means we use the correct curthread while storing the state so it will
not be an issue that the changes to td_critnest are non-atomic.
POSIX states that #include <signal.h> shall make both mcontext_t and
ucontext_t available. Our code even has XXX comment about this.
Add a bit of compliance by moving struct __ucontext definition into
sys/_ucontext.h and including it into signal.h and sys/ucontext.h.
Several machine/ucontext.h headers were changed to use namespace-safe
types (like uint64_t->__uint64_t) to not depend on sys/types.h.
struct __stack_t from sys/signal.h is made always visible in private
namespace to satisfy sys/_ucontext.h requirements.
Apparently mips _types.h pollutes global namespace with f_register_t
type definition. This commit does not try to fix the issue.
PR: 207079
Reported and tested by: Ting-Wei Lan <lantw44@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
If full width writes to the performance monitoring counters are
supported, use full-width aliases MSRs for writes. This fixes the
"[pmc,X] negative increment" assertion on the context switch when
clipped counter value is sign-extended.
Add definitions for the MSR IA32_PERF_CAPABILITIES needed to detect
the feature.
Devin Teske [Fri, 12 Feb 2016 02:53:44 +0000 (02:53 +0000)]
Comments and fix small bug
Reduce differences between jib/jng and fix a bug that would prevent
additional interfaces from being created if the first of many already
existed (counter wasn't incremented before calling only continue).
Devin Teske [Fri, 12 Feb 2016 01:41:40 +0000 (01:41 +0000)]
Add syntax to disable MAC allocation
Adding `!' before an interface name will disable MAC allocation, falling
back to driver mechanics. Alternatively adding `=' before an interface name
causes the MAC address to be cloned (for ng_bridge(4) back-end only). While
here, disable the auto-detection of wlan* since this knocks the host off;
requiring the host that defines the jail to explicitly enable this feature
by preceding the interface with `='.