Commit Graph

202078 Commits

Author SHA1 Message Date
Zbigniew Bodek
721555e7ee Fix KSTACK_PAGES issue when the default value was changed in KERNCONF
If KSTACK_PAGES was changed to anything alse than the default,
the value from param.h was taken instead in some places and
the value from KENRCONF in some others. This resulted in
inconsistency which caused corruption in SMP envorinment.

Ensure all places where KSTACK_PAGES are used the opt_kstack_pages.h
is included.

The file opt_kstack_pages.h could not be included in param.h
because was breaking the toolchain compilation.

Reviewed by:   kib
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3094
2015-07-16 10:46:52 +00:00
Zbigniew Bodek
1038d102c4 Set-up proper TCR values for memory related to Translation Table Walking
This commit adds proper cache and shareability attributes to
the TCR register.
Set memory attributes to Normal, outer and inner cacheable WBWA.
Set shareability to inner and outer shareable when SMP is enabled.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3093
2015-07-16 10:22:57 +00:00
Kevin Lo
f7c698e20d Fix typo in register definition.
Submitted by:	James Hung
Reviewed by:	sbruno
2015-07-16 08:03:23 +00:00
Ed Schouten
457f7e23b1 Implement CloudABI's exec() call.
Summary:
In a runtime that is purely based on capability-based security, there is
a strong emphasis on how programs start their execution. We need to make
sure that we execute an new program with an exact set of file
descriptors, ensuring that credentials are not leaked into the process
accidentally.

Providing the right file descriptors is just half the problem. There
also needs to be a framework in place that gives meaning to these file
descriptors. How does a CloudABI mail server know which of the file
descriptors corresponds to the socket that receives incoming emails?
Furthermore, how will this mail server acquire its configuration
parameters, as it cannot open a configuration file from a global path on
disk?

CloudABI solves this problem by replacing traditional string command
line arguments by tree-like data structure consisting of scalars,
sequences and mappings (similar to YAML/JSON). In this structure, file
descriptors are treated as a first-class citizen. When calling exec(),
file descriptors are passed on to the new executable if and only if they
are referenced from this tree structure. See the cloudabi-run(1) man
page for more details and examples (sysutils/cloudabi-utils).

Fortunately, the kernel does not need to care about this tree structure
at all. The C library is responsible for serializing and deserializing,
but also for extracting the list of referenced file descriptors. The
system call only receives a copy of the serialized data and a layout of
what the new file descriptor table should look like:

    int proc_exec(int execfd, const void *data, size_t datalen, const int *fds,
              size_t fdslen);

This change introduces a set of fd*_remapped() functions:

- fdcopy_remapped() pulls a copy of a file descriptor table, remapping
  all of the file descriptors according to the provided mapping table.
- fdinstall_remapped() replaces the file descriptor table of the process
  by the copy created by fdcopy_remapped().
- fdescfree_remapped() frees the table in case we aborted before
  fdinstall_remapped().

We then add a function exec_copyin_data_fds() that builds on top these
functions. It copies in the data and constructs a new remapped file
descriptor. This is used by cloudabi_sys_proc_exec().

Test Plan:
cloudabi-run(1) is capable of spawning processes successfully, providing
it data and file descriptors. procstat -f seems to confirm all is good.
Regular FreeBSD processes also work properly.

Reviewers: kib, mjg

Reviewed By: mjg

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3079
2015-07-16 07:05:42 +00:00
Justin Hibbits
8947c2986d Fix formatting. 2015-07-16 05:14:20 +00:00
Justin Hibbits
96f3c2adbe Fix userland program exception handling for powerpc64.
It appears that the linker will not handle 64-bit relocations at addresses that
are not aligned to 8-byte boundaries.  Prior to this change the line:

  .llong generictrap

was aligned to a 4-byte address, and the linker replaced that with an 8-byte
0x0.  Aligning that address to 8 bytes caused the linker to generate the proper
relocation.  As a follow-through, the dblow from trap_subr33.S used the code
sequence 'lwz %r1, TRAP_GENTRAP(0)', so this reproduces the analogue of that for
64-bit.
2015-07-16 05:13:08 +00:00
Neel Natu
62145ff347 If uart interrupts are not functioning then schedule the callout to do the
polling at device attach time [1].

Add tunables 'debug.uart_force_poll' and 'debug.uart_poll_freq' to control
uart polling.

Submitted by:	Aleksey Kuleshov (rndfax@yandex.ru) [1]
2015-07-16 04:15:22 +00:00
Marcelo Araujo
e5523594ed Fix a warning spotted by gcc4.9: dereferencing type-punned pointer will break
strict-aliasing rules.

Declare some variables as statics as well as some functions that are internal
helpers. Update the function broadcast_result() to a post-K&R definition.

Differential Revision:	D2690
Reviewed by:		rodrigc, dim
2015-07-16 02:34:22 +00:00
Andrey A. Chernov
96a59ba2ae Comment out usr/sbin/mailwrapper removal
because for no mailwrapper case we have:
/usr/sbin/sendmail -> /usr/sbin/mailwrapper
/usr/sbin/mailwrapper -> /usr/libexec/sendmail/sendmail
Add comment explaining it.
2015-07-16 02:08:54 +00:00
Konstantin Belousov
70a3efc14f Do not use atomic_swap_int(9), it is not available on all
architectures.  Atomic_cmpset_int(9) is a direct replacement, due to
loop.  The change fixes arm, arm64, mips an sparc64, which lack
atomic_swap().

Suggested and reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-07-15 21:44:16 +00:00
John-Mark Gurney
57198f08d3 fix the docs, the number of frags per inode (NFPI) changed in r228794
to 2 from 4, but the man page didn't get updated...

other minor changes to make igor happy...

MFC after:	3 days
2015-07-15 21:35:09 +00:00
Baptiste Daroussin
cbc9c8d8d3 Fix trimming spaces writing at index -1 if an empty string is passed
Submitted by:	Gennady Proskurin <gprspb@mail.ru>
2015-07-15 18:49:15 +00:00
Konstantin Belousov
615b6ea2c8 Reset non-zero it_need indicator to zero atomically with fetching its
current value.  It is believed that the change is the real fix for the
issue which was covered over by the r252683.

With the current code, if the interrupt handler sets it_need between
read and consequent reset, the update could be lost and
ithread_execute_handlers() would not be called in response to the lost
update.

The r252683 could have hide the issue since at the moment of commit,
atomic_load_acq_int() did locked cmpxchg on the variable, which puts
the cache line into the exclusive owned state and clears store
buffers.  Then the immediate store of zero has very high chance of
reusing the exclusive state of the cache line and make the load and
store sequence operate as atomic swap.

For now, add the acq+rel fence immediately after the swap, to not
disturb current (but excessive) ordering.  Acquire is needed for the
ih_need reads after the load, while release does not serve a useful
purpose [*].

Reviewed by:	alc
Noted by:	alc [*]
Discussed with:	bde
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-07-15 17:36:35 +00:00
Konstantin Belousov
03bbcb2f0c Style. Remove excessive brackets. Compare non-boolean with zero.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-07-15 17:14:05 +00:00
Andrew Turner
63e8633e80 Fix an infinite loop when a node doesn't have an interrupt-parent property.
Submitted by:	Aleksey Kuleshov <rndfax@yandex.ru>
Differential Revision: https://reviews.freebsd.org/D3041
2015-07-15 13:28:25 +00:00
Alexander Motin
7dbe8f175b MULTI_ID supported does not mean it is used. 2015-07-15 12:04:12 +00:00
Ed Schouten
952c6e1010 Implement the trivial socket system calls: shutdown() and listen(). 2015-07-15 11:27:34 +00:00
Zbigniew Bodek
b49baf8065 Add identify_cpu() to ARM64 init_secondary routine
Identify current CPU. This is necessary to setup
affinity registers and to provide support for
runtime chip identification.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3095
2015-07-15 09:24:45 +00:00
Ed Schouten
4fa92fb538 Make posix_fallocate() and posix_fadvise() work.
We can map these system calls directly to the FreeBSD counterparts. The
other filesystem related system calls will be sent out for review
separately, as they are a bit more complex to get right.
2015-07-15 09:14:06 +00:00
John-Mark Gurney
8239de9b1b fix error message... errx since errno may not be set (if we didn't
parse the full field), and err and errx add their own newline at the
end...

Sponsored by:	Netflix, Inc.
2015-07-15 06:14:04 +00:00
Allan Jude
ce808c7ad8 Add a new option to gpart(8) to fix Lenovo BIOS boot issue
PR:		184910
Reviewed by:	ae, wblock
Approved by:	marcel
MFC after:	3 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3065
2015-07-15 02:23:55 +00:00
Patrick Kelsey
2ec930efea Revert inadvertent change to amd64/GENERIC. 2015-07-15 01:04:54 +00:00
Patrick Kelsey
8aa7fdbd78 Add netmap support for ixgbe SRIOV VFs (that is, to if_ixv).
Differential Revision: https://reviews.freebsd.org/D2923
Reviewed by: erj, gnn
Approved by: jmallett (mentor)
Sponsored by: Norse Corp, Inc.
2015-07-15 01:02:01 +00:00
Hiren Panchasara
fd3e9bafbd Remove FreeBSD version check for deprecated M_FLOWID.
Reviewed by:	    erj
Sponsored by:	    Limelight Networks
2015-07-15 01:01:17 +00:00
Patrick Kelsey
c8ed84db3a Fix igxbe SRIOV VF (if_ixv) initialization bugs. The MAC address for
an if_ixv instance can now set at creation time, and the receive ring
tail pointer is correctly initialized (previously, things still worked
because the receive ring tail pointer was being fixed up as a side
effect of other activity).

Differential Revision: https://reviews.freebsd.org/D2922
Reviewed by: erj, gnn
Approved by: jmallett (mentor)
Sponsored by: Norse Corp, Inc.
2015-07-15 00:35:50 +00:00
Glen Barber
993c9df745 Remove the r282727 entry for now, pending refinement based
on feedback from andrew@ and ian@.

Sponsored by:	The FreeBSD Foundation
2015-07-14 23:41:13 +00:00
Glen Barber
2fa958e941 Document r279824, dtb module for AM335x systems.
Sponsored by:	The FreeBSD Foundation
2015-07-14 21:45:51 +00:00
Glen Barber
5bb773bf0b Document r278340, rpi.dtb installed into /boot/dtb for the
Raspberry Pi by default.

Sponsored by:	The FreeBSD Foundation
2015-07-14 21:45:48 +00:00
Glen Barber
a9f7cd7efb Document r278338, rpi.dtb module.
Sponsored by:	The FreeBSD Foundation
2015-07-14 21:45:46 +00:00
Glen Barber
86b417b980 Document r283514, sfxge(4) 7XXX-series NIC support.
Add Solarflare Communications to sponsors.ent.

Sponsored by:	The FreeBSD Foundation
2015-07-14 21:45:43 +00:00
Glen Barber
02517a12da Document r282215, SIFTR kernel configuration option.
Sponsored by:	The FreeBSD Foundation
2015-07-14 21:45:40 +00:00
Glen Barber
0fb2c495b4 Document r281495, PAE_TABLES option.
Sponsored by:	The FreeBSD Foundation
2015-07-14 21:45:37 +00:00
Glen Barber
2059d5bca0 Document r273849, timeo, actimeo, noac, proto mount_nfs(8) options.
Sponsored by:	The FreeBSD Foundation
2015-07-14 21:45:35 +00:00
Ed Schouten
bc41a24735 Fix the build after breaking it in r285549.
I performed the commit on a different system as where I wrote the
change. After pulling in the change from Phabricator, I didn't notice
that a single chunk did not apply.

Approved by:	secteam (implicit, as intended change was approved)
Pointy hat to:	me
2015-07-14 20:45:24 +00:00
Glen Barber
838bff69e3 Reword the r282731 entry.
Sponsored by:	The FreeBSD Foundation
2015-07-14 20:10:16 +00:00
Glen Barber
a5c8d84e2b Document r279950, bzipfs support in EFI loader.
Sponsored by:	The FreeBSD Foundation
2015-07-14 20:10:14 +00:00
Glen Barber
d219687436 Document r282731, ubldr is relocatable.
Sponsored by:	The FreeBSD Foundation
2015-07-14 20:10:12 +00:00
Glen Barber
20424724c9 Document r282727, support for booting relocatable kernels extended
beyond non-EFI systems.

Sponsored by:	The FreeBSD Foundation
2015-07-14 20:10:09 +00:00
Glen Barber
256e9f5ae3 Document r277962, support for booting relocatable PowerPC kernels.
Sponsored by:	The FreeBSD Foundation
2015-07-14 20:10:07 +00:00
Glen Barber
8d2d5dabb3 Document r277644, AUDMUX, SDMA, SSI support.
Sponsored by:	The FreeBSD Foundation
2015-07-14 20:10:04 +00:00
Glen Barber
0178d33456 Document r268838, support for Toradex Apalis i.MX6 board.
Sponsored by:	The FreeBSD Foundation
2015-07-14 20:10:02 +00:00
Glen Barber
70c58459ce Document r266943, r267390: Support for Exynos 5420 and
SMP enabled by default.

Sponsored by:	The FreeBSD Foundation
2015-07-14 20:09:59 +00:00
Glen Barber
ed275f6425 Document r277042, support to poweroff the BeagleBone Black via
shutdown(8) and poweroff(8) added.

Sponsored by:	The FreeBSD Foundation
2015-07-14 20:09:57 +00:00
Allan Jude
69e4b249f8 Make bsdinstall's zfsboot script align partitions to 4k/1m when the user requests it
PR:		195174
Reviewed by:	darius
Approved by:	brueffer
MFC after:	3 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3062
2015-07-14 19:57:10 +00:00
Joel Dahl
169a18552e mdoc: minor Xr fixes 2015-07-14 19:45:35 +00:00
Joel Dahl
37cba721ff mdoc: add missing .El 2015-07-14 19:43:10 +00:00
Allan Jude
7e3ebc5b0a Set a mountpoint on the root of the pool so user-created datasets have a mountpoint to inherit
Reviewed by:	darius
Approved by:	brueffer
MFC after:	3 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3063
2015-07-14 19:42:40 +00:00
Allan Jude
1bc080435c Have bsdinstall's zfsboot script make /var/audit its own dataset, so it is not part of the OS boot environment
PR:		199864
Submitted by:	Jason Unovitch
Approved by:	brueffer
MFC after:	3 days
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D2861
2015-07-14 19:38:26 +00:00
Baptiste Daroussin
cffa7aa609 Convert atoi(3) to stronum(3) which allows to arguments and report proper errors
to the users

Obtained from:	OpenBSD
2015-07-14 19:16:14 +00:00
Andrew Turner
f3856d8fcb Also accept "ok" to enable a device, some vendor device trees use this when
they mean "okay"
2015-07-14 19:11:16 +00:00