]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoImplement more lockdep stubs in the LinuxKPI.
hselasky [Fri, 2 Mar 2018 08:59:53 +0000 (08:59 +0000)]
Implement more lockdep stubs in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement ktime_get_raw() function in the LinuxKPI.
hselasky [Fri, 2 Mar 2018 08:58:32 +0000 (08:58 +0000)]
Implement ktime_get_raw() function in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement wait_on_bit() function macro in the LinuxKPI.
hselasky [Fri, 2 Mar 2018 08:56:15 +0000 (08:56 +0000)]
Implement wait_on_bit() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoRename callout member in struct timer_list to match the one in struct
hselasky [Fri, 2 Mar 2018 08:52:27 +0000 (08:52 +0000)]
Rename callout member in struct timer_list to match the one in struct
delayed_work in the LinuxKPI. This allows the timer_pending() function
macro to be used with delayed work structures.

No functional nor structural change.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agog_label_ufs: Fix typo from r330264
cem [Fri, 2 Mar 2018 06:02:54 +0000 (06:02 +0000)]
g_label_ufs: Fix typo from r330264

Reported by: O. Hartmann <o.hartmann AT walstatt.org>
Sponsored by: Dell EMC Isilon

6 years agocore.lua(8): Add missing note about core.KEYSTR_CSI
kevans [Fri, 2 Mar 2018 05:38:08 +0000 (05:38 +0000)]
core.lua(8): Add missing note about core.KEYSTR_CSI

6 years agoAdd menu.lua(8), but do not add to distribution
kevans [Fri, 2 Mar 2018 05:36:04 +0000 (05:36 +0000)]
Add menu.lua(8), but do not add to distribution

Distribution will be done after all of the lualoader manpages are created.

Reviewed by: rpokala
Differential Revision: https://reviews.freebsd.org/D14480

6 years agoAdd core.lua(8), but do not add to distribution
kevans [Fri, 2 Mar 2018 05:35:14 +0000 (05:35 +0000)]
Add core.lua(8), but do not add to distribution

Distribution will be done after all of the lualoader manpages are created.

Reviewed by: rpokala
Differential Revision: https://reviews.freebsd.org/D14479

6 years agoThis change is some refactoring of Mark Johnston's changes in r329375
mckusick [Fri, 2 Mar 2018 04:34:53 +0000 (04:34 +0000)]
This change is some refactoring of Mark Johnston's changes in r329375
to fix the memory leak that I introduced in r328426. Instead of
trying to clear up the possible memory leak in all the clients, I
ensure that it gets cleaned up in the source (e.g., ffs_sbget ensures
that memory is always freed if it returns an error).

The original change in r328426 was a bit sparse in its description.
So I am expanding on its description here (thanks cem@ and rgrimes@
for your encouragement for my longer commit messages).

In preparation for adding check hashing to superblocks, r328426 is
a refactoring of the code to get the reading/writing of the superblock
into one place. Unlike the cylinder group reading/writing which
ends up in two places (ffs_getcg/ffs_geom_strategy in the kernel
and cgget/cgput in libufs), I have the core superblock functions
just in the kernel (ffs_sbfetch/ffs_sbput in ffs_subr.c which is
already imported into utilities like fsck_ffs as well as libufs to
implement sbget/sbput). The ffs_sbfetch and ffs_sbput functions
take a function pointer to do the actual I/O for which there are
four variants:

    ffs_use_bread / ffs_use_bwrite for the in-kernel filesystem

    g_use_g_read_data / g_use_g_write_data for kernel geom clients

    ufs_use_sa_read for the standalone code (stand/libsa/ufs.c
but not stand/libsa/ufsread.c which is size constrained)

    use_pread / use_pwrite for libufs

Uses of these interfaces are in the UFS filesystem, geoms journal &
label, libsa changes, and libufs. They also permeate out into the
filesystem utilities fsck_ffs, newfs, growfs, clri, dump, quotacheck,
fsirand, fstyp, and quot. Some of these utilities should probably be
converted to directly use libufs (like dumpfs was for example), but
there does not seem to be much win in doing so.

Tested by: Peter Holm (pho@)

6 years agolualoader: Use string literal \xNN instead of string.char()
kevans [Fri, 2 Mar 2018 03:05:36 +0000 (03:05 +0000)]
lualoader: Use string literal \xNN instead of string.char()

6 years agolualoader: Use #str instead of tracking length with 'n'
kevans [Fri, 2 Mar 2018 02:39:41 +0000 (02:39 +0000)]
lualoader: Use #str instead of tracking length with 'n'

We really gain almost nothing by tracking length separately, especially when
it's as easy as "#str", so reduce complexity.

6 years agolualoader: Fix some lint-mentioned errors
kevans [Fri, 2 Mar 2018 02:39:16 +0000 (02:39 +0000)]
lualoader: Fix some lint-mentioned errors

- nextbootfile is not a variable, but nextboot_file is
- pstatus was explicitly initialized but later clobbered, so don't
  initialize it.

6 years agoUpdate to bmake-201802222
sjg [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 agotag bmake-20180222
sjg [Thu, 1 Mar 2018 23:46:02 +0000 (23:46 +0000)]
tag bmake-20180222

6 years agoImport bmake-20180222
sjg [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 [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'
eadler [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
kevans [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
kevans [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
kevans [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
kevans [Thu, 1 Mar 2018 21:57:08 +0000 (21:57 +0000)]
MFC after: 1 week

6 years agoRemove LOADER_EFI description files
kevans [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
kevans [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
kevans [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
imp [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.
dab [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
wma [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
emaste [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
hselasky [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.
jhibbits [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
kevans [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
kevans [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
cem [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
cem [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
cem [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 [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
kevans [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.
bdrewery [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
manu [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
manu [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
emaste [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.
mav [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 [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
kevans [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...
kevans [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
kevans [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
kevans [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
kevans [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 [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 [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)
emaste [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 [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
emaste [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
kp [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
kp [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
delphij [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.
delphij [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
kevans [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
kevans [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
kevans [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
kevans [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
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
kevans [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
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
kevans [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
kevans [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
cem [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
dab [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
kevans [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...
kevans [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
kevans [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.
jhb [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
imp [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
imp [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.
asomers [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.
markj [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.
mmel [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.
mmel [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.
mmel [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
avg [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
tsoome [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.
trasz [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
trasz [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"
bdrewery [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
jhibbits [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.
jhibbits [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 [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).
mav [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.
mav [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 [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 [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
manu [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.
jhb [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.
jhb [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.
jhb [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
manu [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
manu [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
manu [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
manu [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.
pkelsey [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