]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUpdate to bmake-201802222
Simon J. Gerraty [Fri, 2 Mar 2018 01:53:50 +0000 (01:53 +0000)]
Update to bmake-201802222

Fixes segfault in Var_Set if val is NULL
Don't treat .info as warning with -W

6 years agoImport bmake-20180222
Simon J. Gerraty [Thu, 1 Mar 2018 23:45:44 +0000 (23:45 +0000)]
Import bmake-20180222

From ChangeLog

* VERSION: 20180222
  Merge with NetBSD make, pick up
  o parse.c: avoid calling sysconf for every call to loadfile

* VERSION: 20180218
  Merge with NetBSD make, pick up
  o var.c: Var_Set handle NULL value anytime.

* VERSION: 20180212
  Merge with NetBSD make, pick up
  o parse.c: do not treat .info as warning with -W

* VERSION: 20171207
  Merge with NetBSD make, pick up
  o var.c: Var_Append use Var_Set if var not previously set
    so that VAR_CMD is handled correctly.
    Add a suitable unit-test.

* VERSION: 20171126

* aclocal.m4: use AC_LINK_IFELSE for AC_C___ATTRIBUTE__
  since AC_TRY_COMPILE puts input inside main()
  which upsets modern compilers.

* VERSION: 20171118
  Merge with NetBSD make, pick up
  o var.c: do not append to variable set on command line
    add unit-test to catch this.

6 years agoAdd a function to retrieve the EFI realtime clock capabilities.
Ian Lepore [Thu, 1 Mar 2018 22:57:14 +0000 (22:57 +0000)]
Add a function to retrieve the EFI realtime clock capabilities.

6 years agosys/sys: Use a more common spelling of 'dirent'
Eitan Adler [Thu, 1 Mar 2018 22:38:21 +0000 (22:38 +0000)]
sys/sys: Use a more common spelling of 'dirent'

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC After: 3 days

6 years agoRegenerate src.conf(5) after r330254
Kyle Evans [Thu, 1 Mar 2018 22:04:51 +0000 (22:04 +0000)]
Regenerate src.conf(5) after r330254

6 years agoAdd descriptions for recently added loader options
Kyle Evans [Thu, 1 Mar 2018 22:00:38 +0000 (22:00 +0000)]
Add descriptions for recently added loader options

6 years agoBack out r330252; will reapply with an actual commit message
Kyle Evans [Thu, 1 Mar 2018 21:59:30 +0000 (21:59 +0000)]
Back out r330252; will reapply with an actual commit message

6 years agoMFC after: 1 week
Kyle Evans [Thu, 1 Mar 2018 21:57:08 +0000 (21:57 +0000)]
MFC after: 1 week

6 years agoRemove LOADER_EFI description files
Kyle Evans [Thu, 1 Mar 2018 21:51:20 +0000 (21:51 +0000)]
Remove LOADER_EFI description files

LOADER_EFI functionality got folded into EFI as of r330248.

6 years agostand: Fix build after r330249
Kyle Evans [Thu, 1 Mar 2018 21:46:01 +0000 (21:46 +0000)]
stand: Fix build after r330249

One does not simply convert to SUBDIR.yes in stand without making everything
else in the affected files SUBDIR.yes -- there are better ways to do this.

6 years agostand: Makefile SUBDIR cleanup
Kyle Evans [Thu, 1 Mar 2018 19:59:49 +0000 (19:59 +0000)]
stand: Makefile SUBDIR cleanup

Use SUBDIR.${MK_*} where appropriate. r330248 eliminated most of the
offenders, sweep the rest under the rug.

Differential Revision: https://reviews.freebsd.org/D14545

6 years agoCreate LOADER_UBOOT, and LOADER_OFW. Move these options out of
Warner Losh [Thu, 1 Mar 2018 19:50:55 +0000 (19:50 +0000)]
Create LOADER_UBOOT, and LOADER_OFW. Move these options out of
Makefile.${MACHINE_ARCH} and remove the now-empty files. Generate the
*32 directories on the necessary architectures (well, currently only
amd64) on the fly. Remove LOADER_EFI variable and co-locate it with
EFI.

Differential Review: https://reviews.freebsd.org/D14546

6 years agoAllow the "@" and "!" characters in passwd file GECOS fields.
David Bright [Thu, 1 Mar 2018 17:47:28 +0000 (17:47 +0000)]
Allow the "@" and "!" characters in passwd file GECOS fields.

Two PRs (152084 & 210187) request allowing the "@" and/or "!"
characters in the passwd file GECOS field. The man page for pw does
not mention that those characters are disallowed, Linux supports those
characters in this field, and the "@" character in particular would be
useful for storing email addresses in that field.

PR: 152084, 210187
Submitted by: jschauma@netmeister.org, Dave Cottlehuber <dch@freebsd.org>
Reported by: jschauma@netmeister.org, Dave Cottlehuber <dch@freebsd.org>
Reviewed by: delphij (secteam), vangyzen
MFC after: 1 week
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D14519

6 years agoPowerNV: Initial support for OPAL I2C transfers
Wojciech Macek [Thu, 1 Mar 2018 14:11:07 +0000 (14:11 +0000)]
PowerNV: Initial support for OPAL I2C transfers

Add I2C OPAL driver and a set of dummy-ones to allow
all I2C things on Power8 to attach.

TODO: better async token management

Submitted by:          Wojciech Macek <wma@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          IBM, QCM Technologies

6 years agoRationalize license text on Linuxolator files
Ed Maste [Thu, 1 Mar 2018 13:52:18 +0000 (13:52 +0000)]
Rationalize license text on Linuxolator files

Many licenses on Linuxolator files contained small variations from the
standard FreeBSD license text.  To avoid license proliferation switch to
the standard 2-clause FreeBSD license for those files where I have
permission from each of the listed copyright holders.  Additional files
still waiting on permission from others are listed in review D14210.

Approved by:    dchagin, rdivacky, sos
MFC after: 1 week
MFC with: r329370
Sponsored by: The FreeBSD Foundation

6 years agoCorrect the return value from flush_work() and flush_delayed_work() in the
Hans Petter Selasky [Thu, 1 Mar 2018 10:31:51 +0000 (10:31 +0000)]
Correct the return value from flush_work() and flush_delayed_work() in the
LinuxKPI to comply more with Linux. This fixes an issue when these functions
are used in waiting loops.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix the psl_userset32 definition.
Justin Hibbits [Thu, 1 Mar 2018 04:44:17 +0000 (04:44 +0000)]
Fix the psl_userset32 definition.

It should be based on psl_userset, not psl_kernset.  As kernset, it would
inherit kernel config, including privilege level.

6 years agolualoader: config: Pull some messages out into constants
Kyle Evans [Thu, 1 Mar 2018 02:31:28 +0000 (02:31 +0000)]
lualoader: config: Pull some messages out into constants

Rather than hardcoding these things. This could lead to some form of loader
localization later, but the main goal at the moment is to get a clear view
of the strings we're outputting and strive to use more string.format() and
less wild concatenation all over the place.

6 years agolualoader: Dedup these "Return to main menu" entries
Kyle Evans [Thu, 1 Mar 2018 02:04:26 +0000 (02:04 +0000)]
lualoader: Dedup these "Return to main menu" entries

6 years agopci_ioctl: Avoid returning uninitialized error value if user provided empty buffer
Conrad Meyer [Thu, 1 Mar 2018 01:49:36 +0000 (01:49 +0000)]
pci_ioctl: Avoid returning uninitialized error value if user provided empty buffer

In the weird case where the user-provided buffer was zero bytes, we could break
out of PCIOCGETCONF and return without initializing error.  In this case,
initialize error to zero -- we successfully did nothing, as requested.

Reported by: Coverity
Sponsored by: Dell EMC Isilon

6 years agopsm(4): Always initialize used values in debug print
Conrad Meyer [Thu, 1 Mar 2018 00:58:59 +0000 (00:58 +0000)]
psm(4): Always initialize used values in debug print

'status' array passed to get_mouse_status() is usually uninitialized by
callers.

Fully populating it with values in get_mouse_status() can fail due to
read_aux_data().

Additionally, nothing in API constrains 'len' to be >= 3.  In practice,
every caller passes three, so perhaps that argument should just be removed.
Refactoring is a larger change, though.

Remove use of potentially uninitialized values by:
1. Only printing 3 debug statuses if the passed array was at least
   'len' >= 3;
2. Populating 'status' array up to first three elements, if read_aux_data()
   failed.

No functional change intended.

Reported by: Coverity
Sponsored by: Dell EMC Isilon

6 years agoffs: softdep_disk_write_complete: Quiesce spurious Coverity warning
Conrad Meyer [Thu, 1 Mar 2018 00:29:52 +0000 (00:29 +0000)]
ffs: softdep_disk_write_complete: Quiesce spurious Coverity warning

Coverity cannot determine that handle_written_indirdep() does not access
uninitialized 'sbp' when flags argument is zero.

So, simply move the initialization slightly sooner to silence the warning.

No functional change.

Reported by: Coverity
Sponsored by: Dell EMC Isilon

6 years agoFix module loading on arm after the metadata.c unification in r329190.
Ian Lepore [Wed, 28 Feb 2018 21:51:51 +0000 (21:51 +0000)]
Fix module loading on arm after the metadata.c unification in r329190.
Arm modules need an additional address fixup not needed by other platforms.

6 years agoRevert r328964: if_awg: Skip emac reset if configured for internal PHY
Kyle Evans [Wed, 28 Feb 2018 20:51:21 +0000 (20:51 +0000)]
Revert r328964: if_awg: Skip emac reset if configured for internal PHY

This broke EFI boots consistently, and emac reset is sometimes needed if
things get into a bad state -- this won't be done without a full powercycle.

6 years agoAllow overriding .MAKE.MAKEFILE_PREFERENCE.
Bryan Drewery [Wed, 28 Feb 2018 20:06:03 +0000 (20:06 +0000)]
Allow overriding .MAKE.MAKEFILE_PREFERENCE.

This will be utilized by Ports tools to avoid some extra
stat(2) calls.

MFC after: 3 days

6 years agoRK3188: Mark it NO_UNIVERSE
Emmanuel Vadot [Wed, 28 Feb 2018 19:08:52 +0000 (19:08 +0000)]
RK3188: Mark it NO_UNIVERSE

This is an old kernel so mark it as NO_UNIVERSE so it's not built by
the universe rule or tinderbox.

6 years agodwmmc_rockchip: Add ifdefs on EXT_RESOURCES
Emmanuel Vadot [Wed, 28 Feb 2018 19:05:25 +0000 (19:05 +0000)]
dwmmc_rockchip: Add ifdefs on EXT_RESOURCES

The old RK3188 kernel config uses dwmmc but isn't compiled with EXT_RESOURCES.
Add ifdefs around code using EXT_RESOURCES code.

Reported by: rpokala

6 years agorc.d/jail: avoid misinterpreting expr arguments
Ed Maste [Wed, 28 Feb 2018 17:20:10 +0000 (17:20 +0000)]
rc.d/jail: avoid misinterpreting expr arguments

(Due to some misconfiguration) I ended up with _mask set to
"-v<something>", and /etc/rc.d/jail then failed with
"expr: illegal option -- v".

Use "expr --" so that variable content is never interpreted as an
option.

Reviewed by: jamie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14535

6 years agoAdd support for Enhanced Gen 5 (16Gb) and Gen 6 (32Gb) QLogic FC HBAs.
Alexander Motin [Wed, 28 Feb 2018 16:24:32 +0000 (16:24 +0000)]
Add support for Enhanced Gen 5 (16Gb) and Gen 6 (32Gb) QLogic FC HBAs.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

6 years agoAllow releasing APs to take more time, as long as we are making progress.
Andrew Turner [Wed, 28 Feb 2018 16:03:40 +0000 (16:03 +0000)]
Allow releasing APs to take more time, as long as we are making progress.
On large core count machines this can be slow while all the CPUs update
the online counter.

Sponsored by: DARPA, AFRL
Sponsored by: Cavium (Hardware)

6 years agoRegenerate src.conf(5) after r330118
Kyle Evans [Wed, 28 Feb 2018 15:48:08 +0000 (15:48 +0000)]
Regenerate src.conf(5) after r330118

6 years agoAdd missing punctuation to *_LOADER_EFI descriptions...
Kyle Evans [Wed, 28 Feb 2018 15:47:24 +0000 (15:47 +0000)]
Add missing punctuation to *_LOADER_EFI descriptions...

6 years agoRegenerate src.conf(5) after r330115 and r330116
Kyle Evans [Wed, 28 Feb 2018 15:45:14 +0000 (15:45 +0000)]
Regenerate src.conf(5) after r330115 and r330116

6 years agoSome missing LOADER_EFI build option descriptions
Kyle Evans [Wed, 28 Feb 2018 15:28:04 +0000 (15:28 +0000)]
Some missing LOADER_EFI build option descriptions

6 years agoAdd missing WITH_BSD_GREP_FASTMATCH description
Kyle Evans [Wed, 28 Feb 2018 15:27:36 +0000 (15:27 +0000)]
Add missing WITH_BSD_GREP_FASTMATCH description

MFC after: 3 days

6 years agoCount the number of GIC redistributors in the ACPI tables. The GICv3 driver
Andrew Turner [Wed, 28 Feb 2018 15:25:47 +0000 (15:25 +0000)]
Count the number of GIC redistributors in the ACPI tables. The GICv3 driver
needs this to allocate memory, and connect the CPUs to the interrupt
controller.

Sponsored by: DARPA, AFRL
Sponsored by: Cavium (Hardware)

6 years agoOnly check the ProducerConsumer flag on extended memory. As per the ACPI
Andrew Turner [Wed, 28 Feb 2018 15:18:31 +0000 (15:18 +0000)]
Only check the ProducerConsumer flag on extended memory. As per the ACPI
6.0 spec 6.4.3.5 bit 0 is ignored on QWord, DWord, and Word Address Space
Descriptors, but not Extended Address Space Descriptors.

Reviewed by: jhb
Sponsored by: DARPA, AFRL
Sponsored by: Cavium (Hardware)
Differential Revision: https://reviews.freebsd.org/D14516

6 years agoRegen src.conf.5 after r330110 (WITH_KERNEL_RETPOLINE)
Ed Maste [Wed, 28 Feb 2018 15:03:53 +0000 (15:03 +0000)]
Regen src.conf.5 after r330110 (WITH_KERNEL_RETPOLINE)

As a bonus also includes the LUA loader description.

6 years agoThe Arm pl011 driver assumes it's running a devicetree based system.
Andrew Turner [Wed, 28 Feb 2018 15:02:27 +0000 (15:02 +0000)]
The Arm pl011 driver assumes it's running a devicetree based system.
It calls OF_* functions to check if it needs to implement workarounds.
This may not be the case on arm64 where we support both FDT and ACPI.
Fix this by checking if we are booting on FDT before calling these checks.

Reviewed by: ian
Sponsored by: DARPA, AFRL
Sponsored by: Cavium (Hardware)
Differential Revision: https://reviews.freebsd.org/D14515

6 years agoAdd kernel retpoline option for amd64
Ed Maste [Wed, 28 Feb 2018 14:57:45 +0000 (14:57 +0000)]
Add kernel retpoline option for amd64

Retpoline is a compiler-based mitigation for CVE-2017-5715, also known
as Spectre V2, that protects against speculative execution branch target
injection attacks.

In this commit it is disabled by default, but will be changed in a
followup commit.

Reviewed by: bdrewery (previous version)
MFC after: 3 days
Security: CVE-2017-5715
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14242

6 years agopf: Apply $pf_flags when verifying the pf.conf file
Kristof Provost [Wed, 28 Feb 2018 09:59:58 +0000 (09:59 +0000)]
pf: Apply $pf_flags when verifying the pf.conf file

When checking the validity of the pf.conf file also include the user supplied
pf_flags. These flags might overrule macros or specify anchors, which we will
apply when actually applying the pf.conf file, so we must also take them into
account when verifying the validity.

Submitted by: Andreas Longwitz <longwitz at incore.de>
MFC after: 3 weeks

6 years agopf: Do not flush on reload
Kristof Provost [Wed, 28 Feb 2018 08:53:07 +0000 (08:53 +0000)]
pf: Do not flush on reload

pfctl only takes the last '-F' argument into account, so this never did what
was intended.

Moreover, there is no reason to flush rules before reloading, because pf keeps
track of the rule which created a given state. That means that existing
connections will keep being processed according to the rule which originally
created them. Simply reloading the (new) rules suffices. The new rules will
apply to new connections.

PR: 127814
Submitted by: Andreas Longwitz <longwitz at incore.de>
MFC after: 3 weeks

6 years agoMFV r330102: ntp 4.2.8p11
Xin LI [Wed, 28 Feb 2018 07:59:55 +0000 (07:59 +0000)]
MFV r330102: ntp 4.2.8p11

6 years agoVendor import of ntp-4.2.8p11.
Xin LI [Wed, 28 Feb 2018 06:23:12 +0000 (06:23 +0000)]
Vendor import of ntp-4.2.8p11.

6 years agolualoader: Add note that \027 is a decimal representation
Kyle Evans [Wed, 28 Feb 2018 05:11:10 +0000 (05:11 +0000)]
lualoader: Add note that \027 is a decimal representation

We've included an extra '0' in there (which might get removed later, but
it's maintained for the moment for legacy purposes) which oftentimes
indicate that the following number should be treated as octal. This is not
the case, so note that to prevent future confusion (of myself and others).

6 years agolualoader: Remove debug function
Kyle Evans [Wed, 28 Feb 2018 05:02:05 +0000 (05:02 +0000)]
lualoader: Remove debug function

Our module bits ended up more stable than I anticipated, so this turns out
to be no longer useful.

If things like this need to come back, we should do it in a separate 'debug'
module to serve as a collection of debugging aides. As a rule, this 'debug'
module would *not* be allowed as a requirement of any other modules in-tree.

6 years agolualoader: Further screen cleanup
Kyle Evans [Wed, 28 Feb 2018 04:31:19 +0000 (04:31 +0000)]
lualoader: Further screen cleanup

- Add screen.default_x and screen.default_y to determine where
  screen.defcursor resets the cursor to.
- Use screen.setcursor in screen.defcursor instead of rewriting the escape
  sequence.
- Use screen.default_y when resetting the cursor after writing the new
  twiddle character, add a comment verbally describing the position just in
  case.

6 years agolualoader: Re-do twiddle
Kyle Evans [Wed, 28 Feb 2018 04:23:28 +0000 (04:23 +0000)]
lualoader: Re-do twiddle

It worked on my test setup, but is clearly non-functional on others.

Further examination of check-password.4th showed that it actually reset the
cursor to 0,25 every time and overwrote the previous password prompt. Do
that, and also clear the "Incorrect Password" text if the correct password
gets entered.

6 years agoRevert r314685 in ps
Mike Karels [Wed, 28 Feb 2018 00:17:08 +0000 (00:17 +0000)]
Revert r314685 in ps

Revert r314685, and add a comment describing the original
behavior and the intent.

Reviewed by: dab@ vangyzen@ jhb@
Differential Revision: https://reviews.freebsd.org/D14530

6 years agoAdd 'usr.bin/seq' to tests mtree after r330086
Kyle Evans [Tue, 27 Feb 2018 22:22:23 +0000 (22:22 +0000)]
Add 'usr.bin/seq' to tests mtree after r330086

6 years agoWhen checking the TCP fast cookie length, conststently also check
Michael Tuexen [Tue, 27 Feb 2018 22:12:38 +0000 (22:12 +0000)]
When checking the TCP fast cookie length, conststently also check
for the minimum length.

This fixes a bug where cookies of length 2 bytes (which is smaller
than the minimum length of 4) is provided by the server.

Sponsored by: Netflix, Inc.

6 years agolualoader: Correct test sense, comments, and add some more comments
Kyle Evans [Tue, 27 Feb 2018 22:07:41 +0000 (22:07 +0000)]
lualoader: Correct test sense, comments, and add some more comments

6 years agolualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSI
Kyle Evans [Tue, 27 Feb 2018 22:02:39 +0000 (22:02 +0000)]
lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSI

6 years agoseq(1): Consistently include 'last' for non-integers
Conrad Meyer [Tue, 27 Feb 2018 22:01:40 +0000 (22:01 +0000)]
seq(1): Consistently include 'last' for non-integers

The source of error is a rounded increment being too large and thus the loop
steps slightly past 'last'.  Perform a final comparison using the formatted
string values (truncated precision) to determine if we still need to print
the 'last' value.

PR: 217149
Submitted by: Fernando Apesteguía <fernando.apesteguia AT gmail.com>,
Yuri Pankov <yuripv AT icloud.com> (earlier version)
Reported by: Martijn Dekker <mcdutchie AT hotmail.com>
Sponsored by: Dell EMC Isilon

6 years agodhclient violates RFC2131 when sending early DHCPREQUEST message to re-obtain old IP
David Bright [Tue, 27 Feb 2018 21:59:23 +0000 (21:59 +0000)]
dhclient violates RFC2131 when sending early DHCPREQUEST message to re-obtain old IP

When dhclient first starts, if an old IP address exists in the
dhclient.leases file, dhclient(8) sends early DHCPREQUEST message(s)
in an attempt to re-obtain the old IP address again. These messages
contain the old IP as a requested-IP-address option in the message
body (correct) but also use the old IP address as the packet's source
IP (incorrect).

RFC2131 sec 4.1 states:

  DHCP messages broadcast by a client prior to that client obtaining
  its IP address must have the source address field in the IP header
  set to 0.

The use of the old IP as the packet's source address is incorrect if
(a) the computer is now on a different network or (b) it is on the
same network, but the old IP has been reallocated to another host.

Fix dhclient to use 0.0.0.0 as the source IP in this circumstance
without removing any existing functionality. Any previously-used old
IP is still requested in the body of an early DHCPREQUEST message.

PR: 199378
Submitted by: J.R. Oldroyd <fbsd@opal.com>
Reported by: J.R. Oldroyd <fbsd@opal.com>
Reviewed by: cem, asomers, vangyzen
MFC after: 1 week
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D14527

6 years agolualoader: Replace instances of \027 with KEYSTR_ESCAPE
Kyle Evans [Tue, 27 Feb 2018 21:52:22 +0000 (21:52 +0000)]
lualoader: Replace instances of \027 with KEYSTR_ESCAPE

With exception to drawing bits, which should probably be kept as-is to not
make a mess out of things.

Reported by: rpokala (a while ago)

6 years agolualoader: Remove remnants of testing...
Kyle Evans [Tue, 27 Feb 2018 21:30:24 +0000 (21:30 +0000)]
lualoader: Remove remnants of testing...

twiddle_pos didn't need to be a module-scope local, since it's going to get
reset with every read anyways- it was left-over from other things.

screen.movecursor with a y=-1 setting was from a test of movecursor,
resulting in the twiddle characters being drawn going up the console and
looking quite funky.

6 years agolualoader: Add a twiddle at password prompt
Kyle Evans [Tue, 27 Feb 2018 21:22:57 +0000 (21:22 +0000)]
lualoader: Add a twiddle at password prompt

This gives some form of feedback while typing, and matches-(ish*) Forth
behavior. The cursor generally rests two column after the password prompt,
then the twiddle is drawn three columns later and the cursor reset to
resting position after being drawn.

I've removed the note about re-evaluating it for security considerations and
instead set it up as a module-local variable that we can set later depending
on environment or something. It's set to false with no chance of changing at
the moment.

*As close as I can tell from reading check-password.4th, because I don't
have an easy test (or deployed) setup for forth loader to check how close
it is. Please do mention if it's not close enough.

6 years agoMove #include for rijndael.h out of x86-specific region.
John Baldwin [Tue, 27 Feb 2018 17:51:58 +0000 (17:51 +0000)]
Move #include for rijndael.h out of x86-specific region.

The #include was added inside of the conditional by accident and the lack
of it broke non-x86 builds.

Reported by: lwhsu (jenkins), andrew

6 years agoDoc __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and BROKEN_OPTIONS
Warner Losh [Tue, 27 Feb 2018 17:36:01 +0000 (17:36 +0000)]
Doc __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and BROKEN_OPTIONS
in one paragraph to highlight the relationship between them.

Suggested by: kevans@

6 years agoMove EFI up to common makefile. There's no need for all these .if's
Warner Losh [Tue, 27 Feb 2018 17:35:29 +0000 (17:35 +0000)]
Move EFI up to common makefile. There's no need for all these .if's
based on architecture.

Sponsored by: Netflix

6 years agofix typo in ipfw(8). No functional change.
Alan Somers [Tue, 27 Feb 2018 17:12:33 +0000 (17:12 +0000)]
fix typo in ipfw(8).  No functional change.

Submitted by: zxzharmlesszxz
Pull Request: https://github.com/freebsd/freebsd/pull/132

6 years agoGive the 0th domain's page daemon thread a consistent name.
Mark Johnston [Tue, 27 Feb 2018 16:51:09 +0000 (16:51 +0000)]
Give the 0th domain's page daemon thread a consistent name.

Page daemon threads for other domains show up in ps(1) output as
"pagedaemon/domN", so let that be the case for domain 0 as well.

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14518

6 years agoDefine meaning of remaining clock rounding flags combinations.
Michal Meloun [Tue, 27 Feb 2018 16:08:08 +0000 (16:08 +0000)]
Define meaning of remaining clock rounding flags combinations.

MFC after: 2 weeks

6 years agoMake rtld_bind_start() debugger friendly.
Michal Meloun [Tue, 27 Feb 2018 15:35:11 +0000 (15:35 +0000)]
Make rtld_bind_start() debugger friendly.
Save link register and annotate call frame structure so debugger can unwind
call frame created by rtld_bind_start().

MFC after: 2 weeks

6 years agoSwitch to mainstream DTS for Raspberry Pi-B and Pi-2.
Michal Meloun [Tue, 27 Feb 2018 15:01:17 +0000 (15:01 +0000)]
Switch to mainstream DTS for Raspberry Pi-B  and Pi-2.
This is first step in attempt to make FreeBSD compatible with all variants of
RPi boards.

Reviewed by: gonzo
MFC after: 3 weeks

6 years agoadd ZFS_ENTER protection to .zfs/snapshot vnode operations that need it
Andriy Gapon [Tue, 27 Feb 2018 14:08:54 +0000 (14:08 +0000)]
add ZFS_ENTER protection to .zfs/snapshot vnode operations that need it

Those operations, zfsctl_snapdir_readdir and zfsctl_snapdir_getattr,
access the filesystem's objset and it can be unstable during operations
like receive and rollback.

MFC after: 2 weeks

6 years agolibsa: replace remaining _write callbacks by null_write
Toomas Soome [Tue, 27 Feb 2018 12:53:25 +0000 (12:53 +0000)]
libsa: replace remaining _write callbacks by null_write

There are some _write callbacks left only returning EROFS, replace them
by null_write. return EROFS from null_write().

Reviewed by: cem, imp, kan
Differential Revision: https://reviews.freebsd.org/D14523

6 years agoFix typo.
Edward Tomasz Napierala [Tue, 27 Feb 2018 10:55:33 +0000 (10:55 +0000)]
Fix typo.

Submitted by: jilles@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoImprove missing tty handling in init(8). This removes a check that did
Edward Tomasz Napierala [Tue, 27 Feb 2018 10:54:15 +0000 (10:54 +0000)]
Improve missing tty handling in init(8).  This removes a check that did
nothing - it was checking for ENXIO, which, with devfs, is no longer
returned - and was badly placed anyway, and replaces it with similar
one that works, and is done just before starting getty, instead of being
done when rereading ttys(5).

From the practical point of view, this makes init(8) handle disappearing
terminals (eg /dev/ttyU*) gracefully, without unneccessary getty restarts
and resulting error messages.

Reviewed by: imp@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14307

6 years agoFix some grammar: "signals <...> are set"
Bryan Drewery [Tue, 27 Feb 2018 04:41:14 +0000 (04:41 +0000)]
Fix some grammar: "signals <...> are set"

6 years agoIncrease the size of a reservation granule for TLB locks
Justin Hibbits [Tue, 27 Feb 2018 04:38:27 +0000 (04:38 +0000)]
Increase the size of a reservation granule for TLB locks

A reservation granule on PowerPC is a cache line.

On e500mc and derivatives a cacheline size is 64 bytes, not 32.  Allocate
the maximum size permitted, but only utilize the size that is needed.  On
e500v1 and e500v2 the reservation granule will still be 32 bytes.

6 years agoFix a minor typo.
Justin Hibbits [Tue, 27 Feb 2018 04:23:03 +0000 (04:23 +0000)]
Fix a minor typo.

6 years agoInitialize all members of vm_page::md_page for armv4/5 systems. This fixes
Ian Lepore [Tue, 27 Feb 2018 02:11:23 +0000 (02:11 +0000)]
Initialize all members of vm_page::md_page for armv4/5 systems.  This fixes
a hang in SI_SUB_KMEM sysinit, and is apparently required after r323290.
Inspired by the commit message for r323676.

Reported by: andreast@

6 years agoAllow physically non-contiguous chain frames allocation in mps(4)/mpr(4).
Alexander Motin [Tue, 27 Feb 2018 01:48:13 +0000 (01:48 +0000)]
Allow physically non-contiguous chain frames allocation in mps(4)/mpr(4).

Chain frames required to satisfy all 2K of declared I/Os of 128KB each take
more then a megabyte of a physical memory, all of which existing code tries
allocate as physically contiguous.  This patch removes that physical
contiguousness requirement, leaving only virtual contiguousness.  I was
thinking about other ways of allocation, but the less granular allocation
becomes, the bigger is the overhead and/or complexity, reaching about 100%
overhead if allocate each frame separately.

The patch also bumps the chain frames hard limit from 2K to 16K.  It is more
than enough for the case of default REQ_FRAMES and MAXPHYS (the drivers will
allocate less than that automatically), while in case of increased MAXPHYS
it will control maximal memory usage.

Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14420

6 years agoAdd sysctls/tunables for dbuf cache size.
Alexander Motin [Tue, 27 Feb 2018 01:36:43 +0000 (01:36 +0000)]
Add sysctls/tunables for dbuf cache size.

MFC after: 2 weeks

6 years agoRemove obsolete options from these kernel configs. The functionality these
Ian Lepore [Tue, 27 Feb 2018 00:30:10 +0000 (00:30 +0000)]
Remove obsolete options from these kernel configs.  The functionality these
enabled is now on by default since r313330.

6 years agoAdd a hw.model sysctl oid for armv6/7 which reports the CPU model, similar
Ian Lepore [Mon, 26 Feb 2018 23:58:56 +0000 (23:58 +0000)]
Add a hw.model sysctl oid for armv6/7 which reports the CPU model, similar
to what other arches (all except riscv and armv4/5) do.

Submitted by: Hyun Hwang <hyun@caffeinated.codes>
Differential Revision: https://reviews.freebsd.org/D14465

6 years agork_cru: Add missing break
Emmanuel Vadot [Mon, 26 Feb 2018 22:57:52 +0000 (22:57 +0000)]
rk_cru: Add missing break

6 years agoDon't overflow the ipad[] array when clearing the remainder.
John Baldwin [Mon, 26 Feb 2018 22:17:27 +0000 (22:17 +0000)]
Don't overflow the ipad[] array when clearing the remainder.

After the auth key is copied into the ipad[] array, any remaining bytes
are cleared to zero (in case the key is shorter than one block size).
The full block size was used as the length of the zero rather than the
size of the remaining ipad[].  In practice this overflow was harmless as
it could only clear bytes in the following opad[] array which is
initialized with a copy of ipad[] in the next statement.

Sponsored by: Chelsio Communications

6 years agoMove ccr_aes_getdeckey() from ccr(4) to the cxgbe(4) driver.
John Baldwin [Mon, 26 Feb 2018 22:12:31 +0000 (22:12 +0000)]
Move ccr_aes_getdeckey() from ccr(4) to the cxgbe(4) driver.

This routine will also be used by the TOE module to manage TLS keys.

Sponsored by: Chelsio Communications

6 years agoFetch TLS key parameters from the firmware.
John Baldwin [Mon, 26 Feb 2018 21:56:06 +0000 (21:56 +0000)]
Fetch TLS key parameters from the firmware.

The parameters describe how much of the adapter's memory is reserved for
storing TLS keys.  The 'meminfo' sysctl now lists this region of adapter
memory as 'TLS keys' if present.

Sponsored by: Chelsio Communications

6 years agoMAINTAINERS: add myself for Allwinner and 64bits RockChip
Emmanuel Vadot [Mon, 26 Feb 2018 21:50:13 +0000 (21:50 +0000)]
MAINTAINERS: add myself for Allwinner and 64bits RockChip

6 years agodwmmc_rockchip: Add support for rk3328-dw-mshc
Emmanuel Vadot [Mon, 26 Feb 2018 21:29:01 +0000 (21:29 +0000)]
dwmmc_rockchip: Add support for rk3328-dw-mshc

* Do not use pio mode like rk2928
* Change clocks frequency in update_ios

Tested-On:    Pine64 Rock64 (RK3328)

6 years agodwmmc: Add clock support and other improvements
Emmanuel Vadot [Mon, 26 Feb 2018 21:27:42 +0000 (21:27 +0000)]
dwmmc: Add clock support and other improvements

* If compiled with EXT_RESOURCES look up the "biu" and "ciu" clocks in
  the DT
* Don't use custom property "bus-frequency" but the standard one
  "clock-frequency"
* Use the DT property max-frequency and fall back to 200Mhz if it don't exists
* Add more mmc caps suported by the controller
* Always ack all interrupts
* Subclassed driver can supply an update_ios so they can handle update
  the clocks accordingly
* Take care of the DDR bit in update_ios (no functional change since we
  do not support voltage change for now)
* Make use of the FDT bus-width property

6 years agork3328: Add support for this SoC
Emmanuel Vadot [Mon, 26 Feb 2018 21:25:50 +0000 (21:25 +0000)]
rk3328: Add support for this SoC

* rk_cru is a cru driver that needs to be subclassed by
  the real CRU driver
* rk_clk_pll handle the pll type clock on RockChip SoC, it's only read
  only for now.
* rk_clk_composite handle the different composite clock types (with gate,
  with mux etc ...)
* rk_clk_gate handle the RockChip gates
* rk_clk_mux handle the RockChip muxes (unused for now)
* Only clocks for supported devices are supported for now, the rest will be
  added when driver support comes
* The assigned-clock* property are not handled for now so we rely a lot on the
  bootloader to setup some initial values for some clocks.

6 years agoEnsure signed comparison to avoid false trip of assert during VNET teardown.
Patrick Kelsey [Mon, 26 Feb 2018 20:31:16 +0000 (20:31 +0000)]
Ensure signed comparison to avoid false trip of assert during VNET teardown.

Reported by: lwhsu
MFC after: 1 month

6 years agoFix two memory leaks in syslogd
David Bright [Mon, 26 Feb 2018 19:27:59 +0000 (19:27 +0000)]
Fix two memory leaks in syslogd

A memory leak in syslogd for processing of forward actions was
reported. This modification adapts the patch submitted with that bug
to fix the leak. While testing the modification, another leak was also
found and fixed.

PR: 198385
Submitted by: Sreeram <sreeramabs@yahoo.com>
Reported by: Sreeram <sreeramabs@yahoo.com>
Reviewed by: hrs
MFC after: 1 week
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D14510

6 years agoBump the size of virtual machine disk images from 20G to 30G,
Glen Barber [Mon, 26 Feb 2018 19:26:59 +0000 (19:26 +0000)]
Bump the size of virtual machine disk images from 20G to 30G,
providing more space for a local buildworld to succeed without
attaching separate disks for /usr/src and /usr/obj.

Reported by: mckusick
MFC after: 3 days

Sponsored by: The FreeBSD Foundation

6 years agoAdd a new variant of the GLA2GPA ioctl for use by the debug server.
John Baldwin [Mon, 26 Feb 2018 19:19:05 +0000 (19:19 +0000)]
Add a new variant of the GLA2GPA ioctl for use by the debug server.

Unlike the existing GLA2GPA ioctl, GLA2GPA_NOFAULT does not modify
the guest.  In particular, it does not inject any faults or modify
PTEs in the guest when performing an address space translation.

This is used by bhyve's debug server to read and write memory for
the remote debugger.

Reviewed by: grehan
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D14075

6 years agonv was moved to the 9 section.
Mariusz Zaborski [Mon, 26 Feb 2018 19:08:27 +0000 (19:08 +0000)]
nv was moved to the 9 section.
Fix reference to it.

6 years agoImprove wording of error message when CROSS_TOOLCHAIN is not found.
Brooks Davis [Mon, 26 Feb 2018 19:02:11 +0000 (19:02 +0000)]
Improve wording of error message when CROSS_TOOLCHAIN is not found.

Reported by: emaste, jhb

6 years agoFix a typo: "now" -> "no".
John Baldwin [Mon, 26 Feb 2018 18:50:39 +0000 (18:50 +0000)]
Fix a typo: "now" -> "no".

6 years agolibsa: Partially revert r330023
Kyle Evans [Mon, 26 Feb 2018 18:24:24 +0000 (18:24 +0000)]
libsa: Partially revert r330023

The removal of tmo >= MAXTMO check should not have been done; this is
specifically what handles timeout if MAXWAIT == 0.

MFC after: 1 week

6 years agoiconv uses strlen directly on user supplied memory
David Bright [Mon, 26 Feb 2018 18:23:36 +0000 (18:23 +0000)]
iconv uses strlen directly on user supplied memory

`iconv_sysctl_add` from `sys/libkern/iconv.c` incorrectly limits the
size of user strings, such that several out of bounds reads could have
been possible.

static int
iconv_sysctl_add(SYSCTL_HANDLER_ARGS)
{
struct iconv_converter_class *dcp;
struct iconv_cspair *csp;
struct iconv_add_in din;
struct iconv_add_out dout;
int error;

error = SYSCTL_IN(req, &din, sizeof(din));
if (error)
return error;
if (din.ia_version != ICONV_ADD_VER)
return EINVAL;
if (din.ia_datalen > ICONV_CSMAXDATALEN)
return EINVAL;
if (strlen(din.ia_from) >= ICONV_CSNMAXLEN)
return EINVAL;
if (strlen(din.ia_to) >= ICONV_CSNMAXLEN)
return EINVAL;
if (strlen(din.ia_converter) >= ICONV_CNVNMAXLEN)
return EINVAL;
...

Since the `din` struct is directly copied from userland, there is no
guarantee that the strings supplied will be NULL terminated. The
`strlen` calls could continue reading past the designated buffer
sizes.

Declaration of `struct iconv_add_in` is found in `sys/sys/iconv.h`:

struct iconv_add_in {
int ia_version;
char ia_converter[ICONV_CNVNMAXLEN];
char ia_to[ICONV_CSNMAXLEN];
char ia_from[ICONV_CSNMAXLEN];
int ia_datalen;
const void *ia_data;
};

Our strings are followed by the `ia_datalen` member, which is checked
before the `strlen` calls:

if (din.ia_datalen > ICONV_CSMAXDATALEN)

Since `ICONV_CSMAXDATALEN` has value `0x41000` (and is `unsigned`),
this ensures that `din.ia_datalen` contains at least 1 byte of 0, so
it is not possible to trigger a read out of bounds of the `struct`
however, this code is fragile and could introduce subtle bugs in the
future if the `struct` is ever modified.

PR: 207302
Submitted by: CTurt <cturt@hardenedbsd.org>
Reported by: CTurt <cturt@hardenedbsd.org>
Reviewed by: jhb, vangyzen
MFC after: 1 week
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D14521

6 years agolibsa: Move MAXWAIT from net.h to net.c
Kyle Evans [Mon, 26 Feb 2018 18:14:37 +0000 (18:14 +0000)]
libsa: Move MAXWAIT from net.h to net.c

It's not a setting that has any effect or use outside of the net.c context.

6 years agoFix typo.
Mariusz Zaborski [Mon, 26 Feb 2018 18:06:15 +0000 (18:06 +0000)]
Fix typo.

6 years ago.Xr rctl(8) and cpuset(1).
Edward Tomasz Napierala [Mon, 26 Feb 2018 18:04:17 +0000 (18:04 +0000)]
.Xr rctl(8) and cpuset(1).

PR: 225935
Submitted by: D. Ebdrup <debdrup at gmail.com> (earlier version)
MFC after: 2 weeks

6 years agolibsa: Add MAXWAIT to net for establishing max total timeout
Kyle Evans [Mon, 26 Feb 2018 18:01:35 +0000 (18:01 +0000)]
libsa: Add MAXWAIT to net for establishing max total timeout

Current timeout behavior is to progress in timeout values from MINTMO to
MAXTMO in MINTMO steps before finally timing out. This results in a fairly
long time before operations finally timeout, which may not be ideal for some
use-cases.

Add MAXWAIT that may be configured along with MINTMO/MAXTMO. If we attempt
to start our send/recv cycle over again but MAXWAIT > 0 and MAXWAIT seconds
have already passed, then go ahead and timeout.

This is intended for those that just want to say "timeout after 180 seconds"
rather than calculate and tweak MINTMO/MAXTMO to get their desired timeout.
The default is 0, or "progress from MINTMO to MAXTMO with no exception."

This has been modified since review to allow for it to be defined via CFLAGS
and doing appropriate error checking. Future work may add some Makefile foo
to respect LOADER_NET_MAXWAIT if it's specified in the environment and pass
it in as MAXWAIT accordingly.

Reviewed by: imp, sbruno, tsoome (all previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14389

6 years agoFix gettytab(5) to document f0, f1, and f2 as unsupported; they've been gone
Edward Tomasz Napierala [Mon, 26 Feb 2018 17:51:18 +0000 (17:51 +0000)]
Fix gettytab(5) to document f0, f1, and f2 as unsupported; they've been gone
since r131091.

PR:             184691 (partial)
Submitted by:   naddy@
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation