Michael Tuexen [Sat, 6 Sep 2014 20:03:24 +0000 (20:03 +0000)]
Fix a leak of an address, if the address is scheduled for removal
and the stack is torn down.
Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the
issue.
SDM rev. 50 defines the use of the next 8 bytes in the xstate header.
It is the compaction bitmask, with the highest bit defining if compact
format of the xsave area is used at all.
Adjust the definition of struct xstate_hdr, provide define for bit 63.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Ian Lepore [Sat, 6 Sep 2014 18:43:17 +0000 (18:43 +0000)]
When registering an association between a device and an xref phandle, create
an entry in the xref list if one doesn't already exist for the given handle.
On a system that uses phandle properties, the init-time scan of the tree
which builds the xref list will pre-create entries for every xref handle
that exists in the data. On systems where the xref and node handles are
synonymous there is no phandle property in referenced nodes, and the xref
list will initialize to an empty state. In the latter case, we still need
to be able to associate a device_t with an xref handle, so we create list
entries on the fly as needed. Since the node and xref handles are
synonymous, we have all the info needed to create a list entry at device
registration time.
The downside to this change is that it basically allows on the fly creation
of xref handles as synonyms of node handles, and the association of a
device_t with them. Whether this is a bug or a feature is in the eye of
the beholder, I guess.
Ruslan Bukin [Sat, 6 Sep 2014 18:08:21 +0000 (18:08 +0000)]
o Remove __unused attribute on variables which actually used
o Unmagic 'configuration done' bit
o Move probe() to place before attach() for better navigation
o Use bus_read_n instead of bus_space_read_n functions
Ian Lepore [Sat, 6 Sep 2014 17:50:59 +0000 (17:50 +0000)]
Revert rr271190, it was based on a misunderstanding. The problem of
non-existant device<->xref info needs to be handled by creating the info,
which will come in a subsequent commit.
Add more bits for the XSAVE features from CPUID 0xd, sub-function 1
%eax report.
Print the XSAVE features 0xd/1 in the boot banner. The printcpuinfo()
is executed late enough so that XSAVE is already enabled.
There is no known to me off the shelf hardware that implements any
feature bits except XSAVEOPT, the list is taken from SDM rev. 50. The
banner printing will allow us to note the hardware arrival.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
John Baldwin [Sat, 6 Sep 2014 15:23:28 +0000 (15:23 +0000)]
Create a separate structure for per-CPU state saved across suspend and
resume that is a superset of a pcb. Move the FPU state out of the pcb and
into this new structure. As part of this, move the FPU resume code on
amd64 into a C function. This allows resumectx() to still operate only on
a pcb and more closely mirrors the i386 code.
Ian Lepore [Sat, 6 Sep 2014 15:11:35 +0000 (15:11 +0000)]
Add OF_xref_from_node_strict() which returns -1 if there is no xref handle
for the node. The default routine returns the untranslated handle, which
is sometimes useful, but sometimes you really need to know there's no
entry in the xref<->node<->device translation table.
Andrew Turner [Fri, 5 Sep 2014 18:11:36 +0000 (18:11 +0000)]
Add the fp{get,set}{mask,round} functions to the public symbols in the map.
These are only exported for armv6hf as the soft-float ABIs have these in
the softfloat Symbol.map file.
Robert Watson [Fri, 5 Sep 2014 17:05:51 +0000 (17:05 +0000)]
Garbage collect NFSMINOFF() from the NFS stack; this unused macro replicates
mbuf-initialisation logic that is best left to centralised mbuf utility
code rather than scattered around the kernel.
Robert Watson [Fri, 5 Sep 2014 16:46:28 +0000 (16:46 +0000)]
Clarify a diagnostic printf() in the mbuf code: M_EXT doesn't necessarily
imply a cluster is attached; it could also refer to some other sort of
external storage (e.g., an sf_buf).
Alexander Motin [Fri, 5 Sep 2014 13:45:14 +0000 (13:45 +0000)]
Invert AHCI_Q_NOBSYRES quirk meaning, waiting for readiness by default.
I gave up to update list of Marvell chips that require this quirk.
The final nail was growing number of PCIe/M.2 SSDs where Marvell chips
have PCI IDs of different vendors.
Ed Schouten [Fri, 5 Sep 2014 05:36:32 +0000 (05:36 +0000)]
Roll back r271012 even more aggressively.
I've looked at the GCC sources and I now understand what's going wrong.
THe C11 keywords are simply nonexistent when using C++ mode. They are
marked as C-only in the parser. This is absolutely impractical for
multiple reasons:
- The C11 keywords do not conflict with C++ naming rules. They all start
with _[A-Z]. There is no reason to make them C-only.
- It makes it practically impossible for people to use these keywords in
C header files and expect them to work from within C++ sources.
As I said in my previous commit message: GCC is by far the weirdest
compiler that I've ever used.
Ed Schouten [Fri, 5 Sep 2014 05:20:52 +0000 (05:20 +0000)]
Partially revert r271012.
Incredibly weird: GCC 4.7/4.9 do support the _Noreturn and _Thread_local
keywords, but not during bootstrapping. GCC is by far the weirdest
compiler that I've ever used.
The legacy USB circuit tends to give trouble on MacBook.
While the original report covered MacBook, extend the fix
preemptively for the newer MacBookPro too.
use a straight buffer instead of an iov w/ 1 segment... The aesni
driver when it hits a mbuf/iov buffer, it mallocs and copies the data
for processing.. This improves perf by ~8-10% on my machine...
I have thoughts of fixing AES-NI so that it can better handle segmented
buffers, which should help improve IPSEC performance, but that is for
the future...
Warner Losh [Thu, 4 Sep 2014 22:22:53 +0000 (22:22 +0000)]
Separate out PCI attachment from the main AHCI driver. Move checks of
PCI IDs into quirks, which mostly fit (though you'd get no argument
from me that AHCI_Q_SATA1_UNIT0 is oddly specific). Set these quirks
in the PCI attachment. Make some shared functions public so that PCI
and possibly other bus attachments can use them.
The split isn't perfect yet, but it is functional. The split will be
perfected as other bus attachments for AHCI are written.
Sean Bruno [Thu, 4 Sep 2014 21:31:25 +0000 (21:31 +0000)]
Allow multiple image activators to run on the same execution by changing
imgp->interpreted to a bitmask instead of, functionally, a bool. Each
imgactivator now requires its own flag in interpreted to indicate whether
or not it has already examined argv[0].
Change imgp->interpreted to an unsigned char to add one extra bit for
future use.
With this change, one can execute a shell script from a 64bit host native
make and still get the binmisc image activator to fire for the script
interpreter. Prior to this, execution would fail.
Warner Losh [Thu, 4 Sep 2014 21:28:25 +0000 (21:28 +0000)]
Delete old arm dts tree. This was created by cherry picking from a
full vendor tree. This worked great until it was time to update, but
now it is time to update. Hit the rest button by removing this branch
and re-adding it by a full copy of whatever is in the vendor tree.
Warner Losh [Thu, 4 Sep 2014 21:26:34 +0000 (21:26 +0000)]
Properly trim the vendor tree to include only those files that we want
merged into FreeBSD. Cherry picking from a full vendor tree was too
hard and lead to undestirable svn results.
Note: We only tim the dts* files, we don't trim the dt-bindings tree,
since having all of them causes no problems and the benefit to
trimming there is far out weighed by the cost of doing the trim each
time.
John Baldwin [Thu, 4 Sep 2014 19:09:08 +0000 (19:09 +0000)]
In tcp_input(), don't acquire the pcbinfo global write lock for SYN
packets targeting a listening socket. Permit to reduce TCP input
processing starvation in context of high SYN load (e.g. short-lived TCP
connections or SYN flood).
Ian Lepore [Thu, 4 Sep 2014 14:57:04 +0000 (14:57 +0000)]
Implement the same public interface in imx51 and imx6 iomux; use the common
header file for both. Remove some unused code from imx51_iomux. The iomux
drivers are required, not optional, adjust the files.* entries accordingly.
Revert r269814: blkfront: add support for unmapped IO
Current busdma code for unmapped bios will not properly align the segment
size, causing corruption on blkfront devices. Revert the commit until
busdma code is fixed.
John Baldwin [Thu, 4 Sep 2014 14:26:25 +0000 (14:26 +0000)]
Merge the amd64 and i386 identcpu.c into a single x86 implementation.
This brings the structured extended features mask and VT-x reporting to
i386 and Intel cache and TLB info (under bootverbose) to amd64.
Improve r265338. When inserting mbufs into TCP reassembly queue,
try to collapse adjacent pieces using m_catpkt(). In best case
scenario it copies data and frees mbufs, making mbuf exhaustion
attack harder.
Suggested by: Jonathan Looney <jonlooney gmail.com>
Security: Hardens against remote mbuf exhaustion attack.
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Systems with lots of geom providers can end up with a kern.geom.confxml
value too large for the buffer allocated. Work around this by retrying
a few times with larger buffer sizes.
Ian Lepore [Thu, 4 Sep 2014 03:04:37 +0000 (03:04 +0000)]
The imx5x and imx6 chips have an onboard IOMUX device which also contains a
few "general purpose registers" whose values control chip behavior in ways
that have nothing to do with IO pin mux control. Define a simple API that
other soc-specific code can use to read and write the registers, and provide
the imx51 implementation of them.
John Baldwin [Thu, 4 Sep 2014 02:25:59 +0000 (02:25 +0000)]
- Move blacklists of broken TSCs out of the printcpuinfo() function
and into the TSC probe routine.
- Initialize cpu_exthigh once in finishidentcpu() which is called
before printcpuinfo() (and matches the behavior on amd64).
John Baldwin [Thu, 4 Sep 2014 01:46:06 +0000 (01:46 +0000)]
- Move prototypes for various functions into out of C files and into
<machine/md_var.h>.
- Move some CPU-related variables out of i386/i386/identcpu.c to
initcpu.c to match amd64.
- Move the declaration of has_f00f_hack out of identcpu.c to machdep.c.
- Remove a misleading comment from i386/i386/initcpu.c (locore zeros
the BSS before it calls identify_cpu()) and remove explicit zero
assignments to reduce the diff with amd64.
Do not blindly announce 1000baseT half-duplex capability in
autonegotiation. Some controllers like cgem(4) do not support
half-duplex at gigabit speeds.
Warner Losh [Wed, 3 Sep 2014 21:59:07 +0000 (21:59 +0000)]
Create a /boot/dtb directory to house DTB blobs. The flattened device
tree support includes a device tree source compiler dtc(8) which
converts .dts files into .dtb files. /boot/loader will load dtb files
from this directory by default, allowing for fewer differences between
images for different SoCs. Compiled dts files will wind up here
eventually as an alternative to embedding them into the kernel.
Document this in hier(7), as well as add missing entries for
/boot/firmware and /boot/zfs, though the latter two should only be
considered place holders if someone wants to make them better.
Ian Lepore [Wed, 3 Sep 2014 19:37:41 +0000 (19:37 +0000)]
Remove DIAGNOSTIC from the kernel config of low-end arm systems. Sanity
checks such as vmem_check() can make a low-end system go completely
unresponsive for as much as 3 seconds out of every 10.
John Baldwin [Wed, 3 Sep 2014 19:01:34 +0000 (19:01 +0000)]
Always seek back to the beginning of a regular directory, even if the
previous seek location was 0. Without this, readdir() would see
dd_loc of zero and call getdirentries() which would start reading
entries at the current seek location of the directory ignoring the
first batch of entries. Also, rewinddir() should always seek so that
it reads the directory from the beginning to get updated entries.
PR: 192935
Reported by: iron@mail.ua
MFC after: 3 days
Ed Maste [Wed, 3 Sep 2014 18:51:33 +0000 (18:51 +0000)]
Avoid ./ in zoneinfo entries in METALOG
Use of "find ." resulted in METALOG entries with an extra ./ -- e.g.,
./usr/share/zoneinfo/./America/Toronto. Avoid this by using globbing
via "find *" instead.
Ian Lepore [Wed, 3 Sep 2014 17:51:03 +0000 (17:51 +0000)]
Fixes and enhancements for the if_cgem driver...
- miibus fixes as suggested by Yonghyeon Pyun.
- enable VLAN MTU support.
- fix a few WITNESS complaints in cgem_attach().
- have cgem_attach() properly init the ifnet struct before calling
mii_attach() to fix panic when using e1000phy.
- fix ethernet address changing.
- fix transmit queue overflow handling.
- tweak receive queue handling to reduce receive overflows.
- bring out MAC statistic counters to sysctls.
- add e1000phy to config file.
- implement receive hang work-around described in reference guide.
- change device name from if_cgem to cgem to be consistent with other
interfaces.
John Baldwin [Wed, 3 Sep 2014 17:26:46 +0000 (17:26 +0000)]
Import a hackish tool I use to examine the skew of the TSC across
CPUs in a system. The tool queries the kernel for its set of CPUs
and compares TSC values on each of the additional CPUs to the first
CPU in turn. It then outputs a table of simple statistics.
Sean Bruno [Wed, 3 Sep 2014 15:32:38 +0000 (15:32 +0000)]
Do not direct commit to contrib/llvm. Make the change a patch file instead.
Reverts 271025 but still functionally patches it. Original intent is still
the same. Pointed out by rdivacky.
MFV: Only emit movw on ARMv6T2
Building for the FreeBSD default target ARMv6 was emitting movw ASM on certain
test cases (found building qmake4/5 for ARM). Don't do that, moreover, the AS
in base doesn't understand this instruction for this target. One would need
to use --integrated-as to get this to build if desired.
Sean Bruno [Wed, 3 Sep 2014 14:16:50 +0000 (14:16 +0000)]
MFV: Only emit movw on ARMv6T2
Building for the FreeBSD default target ARMv6 was emitting movw ASM on certain
test cases (found building qmake4/5 for ARM). Don't do that, moreover, the AS
in base doesn't understand this instruction for this target. One would need
to use --integrated-as to get this to build if desired.