Andrew Turner [Tue, 14 Apr 2015 10:40:37 +0000 (10:40 +0000)]
Use MACHINE in the efi loader when it is what we mean, it may not be the
same as MACHINE_CPUARCH, it just happened to be the case the architectures
this code currently supports.
ipcs: fix warnings (WARNS=1 -> WARNS=6)
- fix shadow warnings
- change type from off_t to size_t which is more correct and avoids
signed/unsigned compare
- use new initializer format to avoid "missing values" warning
Neel Natu [Mon, 13 Apr 2015 19:13:51 +0000 (19:13 +0000)]
Modify the return value of the uhci/ehci/xhci PCI probe routines to
'BUS_PROBE_DEFAULT'. This allows bhyve's 'ppt' driver to claim ownership
of the device and pass it through to the guest.
In the common case where there are no competing drivers for USB controllers
this change is a no-op.
Andrew Turner [Mon, 13 Apr 2015 16:00:09 +0000 (16:00 +0000)]
Create the correct symlinks for the machine directory, and only create the
x86 symlink on i386 and amd64. Before this incorrect symlinks were being
created on armi and i386.
Differential Revision: https://reviews.freebsd.org/D2283
Reviewed by: emaste, imp
Sponsored by: The FreeBSD Foundation
Add config option PAE_TABLES for the i386 kernel. It switches pmap to
use PAE format for the page tables, but does not incur other
consequences of the full PAE config. In particular, vm_paddr_t and
bus_addr_t are left 32bit, and max supported memory is still limited
by 4GB.
The option allows to have nx permissions for memory mappings on i386
kernel, while keeping the usual i386 KBI and avoiding the kernel data
sizing problems typical for the PAE config.
Intel documented that the PAE format for page tables is available
starting with the Pentium Pro, but it is possible that the plain
Pentium CPUs have the required support (Appendix H). The goal is to
enable the option and non-exec mappings on i386 for the GENERIC
kernel. Anybody wanting a useful system on 486, have to reconfigure
the modern i386 kernel anyway.
Discussed with: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Andrew Turner [Mon, 13 Apr 2015 14:43:10 +0000 (14:43 +0000)]
Bring in the start of the arm64 kernel.
This is only the minimum set of files needed to boot in qemu. As such it is
missing a few things.
The bus_dma code is currently only stub functions with a full implementation
from the development tree to follow.
The gic driver has been copied as the interrupt framework is different. It
is expected the two drivers will be merged by the arm intrng project,
however this will need to be imported into the tree and support for arm64
would need to be added.
This includes code developed by myself, SemiHalf, Ed Maste, and Robin
Randhawa from ARM. This has been funded by the FreeBSD Foundation, with
early development by myself in my spare time with assistance from Robin.
Differential Revision: https://reviews.freebsd.org/D2199
Reviewed by: emaste, imp
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Andrew Turner [Mon, 13 Apr 2015 13:21:27 +0000 (13:21 +0000)]
Update the arm devmap code to also work with arm64.
There are a few differences between the two. On arm we need to provide a
list of addresses we may be mapping before we have initialised the virtual
memory subsystem, however on arm64 we allocate a small (2MiB for a 4k
granule) range to be used for such purposes.
Differential Revision: https://reviews.freebsd.org/D2249
Sponsored by: The FreeBSD Foundation
Mark Johnston [Mon, 13 Apr 2015 01:55:42 +0000 (01:55 +0000)]
Fix a possible refcount leak in regen_tmpaddr().
public_ifa6 may be set to NULL after taking a reference to a previous
address list element. Instead, only take the reference after leaving the
loop but before releasing the address list lock.
README:
- the reference to 'ancient' LINT file was added in 2000 [r64047 | alex
| 2000-07-31]. Remove the reference entirely now.
- add the tests directory
Pedro F. Giffuni [Sun, 12 Apr 2015 16:43:55 +0000 (16:43 +0000)]
Add definition for the gcc gnu_inline attribute.
This uses a non-standard (who would guess that) inlining method
that is useful for legacy GNU software. This attribute was added
in GCC 4.1.3. Older versions of clang would just ignore the
attribute but as lately it is supported also there.
This is currently unused but it is required for the
FORTIFY_SOURCE extension.
Andrew Turner [Sun, 12 Apr 2015 13:00:58 +0000 (13:00 +0000)]
Add a driver for the ARM Power State Coordination Interface (PSCI). This
handles versions 0.1 and 0.2 of the standard on 32-bit ARM.
With this driver we can shutdown in QEMU. Further work is needed to
turn secondary cores on on boot and to support later revisions of the
specification.
Submitted by: Robin Randhawa <Robin.Randhawa at ARM.com>
Sponsored by: The FreeBSD Foundation
Define capabilities bits from the revision 007 of the document 302223
"Intelб╝ Processor Vendor-Specific ACPI Interface Specification",
issied Dec 2014. Previous revision 005 was from Sep 2006.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Adrian Chadd [Sun, 12 Apr 2015 00:02:32 +0000 (00:02 +0000)]
Start enabling the available GPIO pins on the Carambola 2.
The carambola2 exposes all the gpio pins, but some are reserved for
core functions (eg usb, ethernet, etc.) Others are configured by default
to be available as normal GPIO pins to do interesting things with.
GPIO 18->23 is the I2S, SLIC and SPDIF device pins, but none of those
are currently used. So, just allow those to show up.
Tested:
* AR9344, Carambola 2
* (.. bitbang SPI to an Adafruit LCD via libgpio, because FreeBSD could
do with more shiny output devices that aren't network interfaces.)
TODO:
There are some other pins aren't currently included here, but should be.
The LED pins are for the internal switch inside the AR9344.
* GPIO 0+1 are "LED0 + LED1", but they're tied to high for bootstrapping.
* GPIO 13-17 are "LED2..7", but they're tied (H, L, L, L, H) for bootstrapping.
* GPIO 11 and 12 are UART RTS/CTS or I2S; but GPIO 12 is tied L for bootstrap.
Will Andrews [Sat, 11 Apr 2015 18:51:41 +0000 (18:51 +0000)]
uiomove_object_page(): Avoid instantiating pages in sparse regions on reads.
Check whether the page being requested is either resident or on swap. If
not, read from the zero_region instead of instantiating an unnecessary page.
This avoids consuming memory for sparse files on tmpfs, when they are read
by applications that do not use SEEK_HOLE/SEEK_DATA (which is most of them).
Rui Paulo [Sat, 11 Apr 2015 18:44:07 +0000 (18:44 +0000)]
Improve Synaptics support for newer touchpads.
Enable two finger scrolling by default and disable the edge scrolling if
the touchpad has no physical zone for it. Disable directional scrolling
by default to avoid using extended buttons as scroll buttons.
Add support for ClickPad. On Lenovo laptops, this is the button
reported when one presses the touchpad.
While there, fix a problem where the extended buttons were not reporting
the button release event correctly: we need to save the state of the
buttons and report it to sysmouse until we receive a packet from the
touchpad indicating the button has been released. This makes it
possible to use an extended button to resize a window. On Lenovo
laptops, the major buttons are actually reported as extended buttons.
Andrew Turner [Sat, 11 Apr 2015 17:52:47 +0000 (17:52 +0000)]
Add support for the QEMU virt SoC. This is a SoC built depending on the
command line arguments passed in. It will then generate a dtb on the fly,
as such no dts will be added as it may be incorrect.
Andrew Turner [Sat, 11 Apr 2015 17:16:23 +0000 (17:16 +0000)]
Add support for the uart classes to set their default register shift value.
This is needed with the pl011 driver. Before this change it would default
to a shift of 0, however the hardware places the registers at 4-byte
addresses meaning the value should be 2.
This patch fixes this for the pl011 when configured using the fdt. The
other drivers have a default value of 0 to keep this a no-op.
This modifies several FreeBSD drivers to use the GNU approach to
supply clk81 information. It also changes the hardware strings
in some of the drivers to match what's present in the GNU files.
Enji Cooper [Sat, 11 Apr 2015 06:40:38 +0000 (06:40 +0000)]
- Remove the .t wrapper and put the "magic" of determining the number of
testcases into the .c file
- Require root for now because it fails with SOCK_RAW without root privileges
- Increment the test count properly on socket create failure
Enji Cooper [Sat, 11 Apr 2015 03:38:49 +0000 (03:38 +0000)]
Fix warnings and bump WARNS to 6
- Staticize variables as needed
- Garbage collect argc/argv
- Fix -Wsign-compare warnings by casting small sizeof to (int)
Enji Cooper [Sat, 11 Apr 2015 03:18:14 +0000 (03:18 +0000)]
- Don't use /tmp because it's outside ATF's prescribed sandbox
- Replace a hardcoded PATH_MAX value with sizeof(path)
- Use path like an array, not a pointer, and always try to unlink it in cleanup
Enji Cooper [Sat, 11 Apr 2015 02:50:44 +0000 (02:50 +0000)]
- Use static buffers for temporary file paths instead of strdup of constant strings
- Don't use /tmp because it's outside ATF's prescribed sandbox
- Use mkstemp instead of mktemp to eliminate warning
Xin LI [Sat, 11 Apr 2015 00:45:03 +0000 (00:45 +0000)]
Merge changes from vendor driver version 1.1.1:
v1.1.1 2015-03-26
* Support 4Kn drive.
* Change the SCSI target ID of the disk to be the index of physical
connetion to the HBA.
* Support staggered drive spin up.
* Fix a bug that command would be timeout because of improper
interrupt service routine.
* Error handling to avoid scsi command lost which caused system
hang up.
* Fix a bug that fail to get the devcie's serial number via
FreeNAS WebGUI.
Many thanks to HighPoint for continued support of FreeBSD!
Fix the IPV6_MULTICAST_IF sockopt handling. RFC 3493 says when the
interface index is specified as zero, the system should select the
interface to use for outgoing multicast packets. Even the comment
for the in6p_set_multicast_if() function says about index of zero.
But in fact for zero index the function just returns EADDRNOTAVAIL.
I.e. if you first set some interface and then will try reset it
with zero ifindex, you will get EADDRNOTAVAIL.
Reset im6o_multicast_ifp to NULL when interface index specified as
zero. Also return EINVAL in case when ifnet_byindex() returns NULL.
This will be the same behaviour as when ifindex is bigger than
V_if_index. And return EADDRNOTAVAIL only when interface is not
multicast capable.
Xin LI [Fri, 10 Apr 2015 17:21:47 +0000 (17:21 +0000)]
For reasons that I am not understand yet, using the libmd version of
SHA256 would make libarchive based application to give:
archive_read_extract(): Lzma library error: Corrupted input data
(Internally this is LZMA_DATA_ERR)
However, the libmd version of SHA256 is supposed to give same result
as the bundled version do, and xz(1) is not affected.
As a precaution, revert the SHA256 portion of r281316 for now until
we figure out why it breaks libarchive interoperability as we can't
yet rule out this change have introduced an ABI breakage.
Ian Lepore [Fri, 10 Apr 2015 13:26:35 +0000 (13:26 +0000)]
Add a pmap_kremove_device() to undo mappings made with pmap_kenter_device().
Previously we used pmap_kremove(), but with ARM_NEW_PMAP it does the remove
in a way that isn't SMP-coherent (which is appropriate in some circumstances
such as mapping/unmapping sf buffers). With matching enter/remove routines
for device mappings, each low-level implementation can do the right thing.
Enji Cooper [Fri, 10 Apr 2015 09:21:07 +0000 (09:21 +0000)]
- Parameterize out the number of accept/connect attempts
- Randomize the bind port to allow 2+ consecutive calls in < 10 minutes, and
to also not fail if (for instance) there's a server already listening on port
8080
- Don't leak the listening socket / fds into the child process
- Fix warnings:
-- Remove argc/argv (-Wunused)
-- Mark sig __unused (-Wunused)
-- Mark quit static (-Wmissing-variable-declarations)
Enji Cooper [Fri, 10 Apr 2015 08:01:49 +0000 (08:01 +0000)]
Fix -Wunused warnings, bump WARNS to 6
The output is still broken if prove -rv is run and the testcase aborts
prematurely with fail_assertion (the testcase doesn't really conform to TAP
protocol properly, except when it completes fully)
Enji Cooper [Fri, 10 Apr 2015 07:59:46 +0000 (07:59 +0000)]
Fix -Wunused warnings, bump WARNS to 6
The testcase fails today on subtest # 9
The output is still broken if prove -rv is run and the testcase aborts
prematurely (the testcase doesn't really conform to TAP protocol properly,
except when it completes fully)
o Use Jenkins hash. With previous hash, for a single source IP address and
sequential IP ID case (e.g. ping -f), distribution fell into 8-10 buckets
out of 64. With Jenkins hash, distribution is even.
o Add random seed to the hash.
Move all code related to IP fragment reassembly to ip_reass.c. Some
function names have changed and comments are reformatted or added, but
there is no functional change.
- Fix support with new elftoolchain readelf(1)
- Fix not finding global symbols by checking for D and R.
- Follow symlinks
- Show which matching symbol was used to consider the library needed.