]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoDisable savecore(8)'s libcasper support when WITHOUT_DYNAMICROOT=yes.
markj [Fri, 4 Jan 2019 19:20:19 +0000 (19:20 +0000)]
Disable savecore(8)'s libcasper support when WITHOUT_DYNAMICROOT=yes.

This follows the example of other Capsicumized programs in /sbin.

Reported by: Manfred Antar <manfredantar@gmail.com>
MFC with: r342699
Sponsored by: The FreeBSD Foundation

5 years agoFix i386 LINT build after r342769.
kib [Fri, 4 Jan 2019 19:10:46 +0000 (19:10 +0000)]
Fix i386 LINT build after r342769.

It seems that libkern/mcount.c is the only consumer of vm/pmap.h that
does not include machine/atomic.h.  Make it work by bringing
machine/atomic.h when pmap.h is used for kernel non-asm .c file.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoLimit git history searches in newvers.sh
gallatin [Fri, 4 Jan 2019 18:38:27 +0000 (18:38 +0000)]
Limit git history searches in newvers.sh

newvers.sh takes upwards of 4-5 seconds to complete on trees checked
out from github, due to searching the entire history for non-existent
git-svn metadata. Similarly, if one does not check out notes, we
again search the entire history for notes. That makes newvers.sh very
slow for many github users.

To fix this in a fair way, limit the history search to the last 10K
commits: if you're more than 10K commits out of sync, then you've
forked the project, and our SVN rev is no longer very important to you.

Due to how git implements --grep in conjunction with -n, --grep has been
removed for performance reasons (git does not seem to limit its search
to the -n limit in this case, and takes just as long as it did with no
limit).

Reviewed by: emaste, imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18745

5 years agoAdd explicit csu test dependency
emaste [Fri, 4 Jan 2019 18:35:25 +0000 (18:35 +0000)]
Add explicit csu test dependency

lib/csu/tests/dynamiclib requires libh_csu.so be built first.  I'm not
sure this is the most correct/best way to address this but it solves
the issue in my testing.

PR: 233734
Sponsored by: The FreeBSD Foundation

5 years agoBump __FreeBSD_version for r342771
cem [Fri, 4 Jan 2019 18:34:44 +0000 (18:34 +0000)]
Bump __FreeBSD_version for r342771

5 years agoExpose threads-per-core and physical core count information
cem [Fri, 4 Jan 2019 18:31:17 +0000 (18:31 +0000)]
Expose threads-per-core and physical core count information

With new sysctls (to the best of our ability do detect them).  Restructured
smp.4 slightly for clarity (keep relevant stuff closer to the top) while
documenting.

Reviewed by: markj, jhibbits (ppc parts)
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18322

5 years agoasmc: Patch to add MacBook Pro 9,2 support
dab [Fri, 4 Jan 2019 18:21:49 +0000 (18:21 +0000)]
asmc: Patch to add MacBook Pro 9,2 support

PR: 211513
Submitted by: William Theesfeld Jr <wtheesfeld@mailbox.org>
Reported by: William Theesfeld Jr <wtheesfeld@mailbox.org>
MFC after: 1 week

5 years agoi386: Use atomic 64bit load to read PDE value from PAE pagetables in
kib [Fri, 4 Jan 2019 17:33:07 +0000 (17:33 +0000)]
i386: Use atomic 64bit load to read PDE value from PAE pagetables in
pmap_kextract().

pmap_kextract() can race with promotion/demotion on the kernel page
table, in which case current non-atomic 64bit read would see torn
value, breaking pmap_kextract().  pmap_kextract() would correctly
handle either promoted or demoted PDE, but not a mix where one word
is from a different state.

It requires PAE and > 4G memory to reproduce.  We observed this in
real loads, both for intensive use of malloc(9)/free(9) where
vtoslab() returned invalid pointer to the slab, and with the use of
busdma_bounce, where incorrect page was bounced.

In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18714

5 years agoSupport MSG_DONTWAIT in send*(2).
markj [Fri, 4 Jan 2019 17:31:50 +0000 (17:31 +0000)]
Support MSG_DONTWAIT in send*(2).

As it does for recv*(2), MSG_DONTWAIT indicates that the call should
not block, returning EAGAIN instead.  Linux and OpenBSD both implement
this, so the change makes porting easier, especially since we do not
return EINVAL or so when unrecognized flags are specified.

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: tuexen
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18728

5 years agox86: Report per-cpu IPI TLB shootdown generation in ddb 'show pcpu' output.
kib [Fri, 4 Jan 2019 17:25:47 +0000 (17:25 +0000)]
x86: Report per-cpu IPI TLB shootdown generation in ddb 'show pcpu' output.

It is useful for inspecting tlb shootdown hangs.  The smp_tlb_generation value
is available using regular ddb data inspection commands.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoDon't enable interrupts in init_secondary().
markj [Fri, 4 Jan 2019 17:14:50 +0000 (17:14 +0000)]
Don't enable interrupts in init_secondary().

The MI kernel assumes that interrupts will not be enabled on APs until
after the first context switch.  In particular, the problem was causing
occasional deadlocks during boot.

Remove an unneeded intr_disable() added in r335005.

Reviewed by: jhb (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18738

5 years agoFix dirty bit handling in pmap_remove_write().
markj [Fri, 4 Jan 2019 17:10:16 +0000 (17:10 +0000)]
Fix dirty bit handling in pmap_remove_write().

Reviewed by: jhb, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18732

5 years agoClear PGA_WRITEABLE in pmap_remove_pages().
markj [Fri, 4 Jan 2019 17:08:45 +0000 (17:08 +0000)]
Clear PGA_WRITEABLE in pmap_remove_pages().

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18731

5 years agonewvers: retire p4 version support
emaste [Fri, 4 Jan 2019 16:47:35 +0000 (16:47 +0000)]
newvers: retire p4 version support

Perforce no longer offers a FreeBSD client and it not a viable VCS for
FreeBSD development.  Remove p4 version logic to simplify newvers.sh in
advance of other changes.

Sponsored by: The FreeBSD Foundation

5 years agoFix bhyve's NVMe Completion Queue entry values
chuck [Fri, 4 Jan 2019 15:03:35 +0000 (15:03 +0000)]
Fix bhyve's NVMe Completion Queue entry values

The function which processes Admin commands was not returning the
Command Specific value in Completion Queue Entry, Dword 0 (CDW0). This
effects commands such as Set Features, Number of Queues which returns
the number of queues supported by the device in CDW0. In this case, the
host will only create 1 queue pair (Number of Queues is zero based).
This also masked a bug in the queue counting logic.

Reviewed by: imp, araujo
Approved by: imp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18703

5 years agoFix bhyve's NVMe queue bookkeeping
chuck [Fri, 4 Jan 2019 15:03:30 +0000 (15:03 +0000)]
Fix bhyve's NVMe queue bookkeeping

Many size / length parameters in NVMe are "0's based", meaning, a value
of 0x0 represents 1, 0x1 represents 2, etc.. While this leads to an
efficient encoding, it can lead to subtle bugs. With respect to queues,
these parameters include:
 - Maximum number of queue entries
 - Maximum number of queues
 - Number of Completion Queues
 - Number of Submission Queues

To be consistent, convert all 0's based values from the host to 1's
based value internally. Likewise, covert internal 1's based values to
0's based values when returned to the host. This fixes an off-by-one bug
when creating IO queues and simplifies some of the code. Note that this
bug is masked by another bug.

While in the neighborhood,
 - fix an erroneous queue ID check (checking CQ count when deleting SQ)
 - check for queue ID of 0x0 in a few places where this is illegal
 - clean up the Set Features, Number of Queues command and check for
   illegal values

Reviewed by: imp, araujo
Approved by: imp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18702

5 years agonewvers: avoid clearing svn revision information with nested VCS dirs
emaste [Fri, 4 Jan 2019 14:42:36 +0000 (14:42 +0000)]
newvers: avoid clearing svn revision information with nested VCS dirs

Consider the case where FreeBSD is checked out via Subversion with a
(perhaps unrelated) .git or .hg directory at a higher level - for
example,

    .../.git
    .../src/freebsd

Previously newvers obtained the SVN revision information via svnversion,
and then tried to obtain the SVN revision corresponding to the git or hg
commit, overwriting the existing information.

As a short term fix use a different variable for hg-svn or git-svn
information, setting $svn from hg or git info only if not empty.

Reported by: Matthias Apitz
Sponsored by: The FreeBSD Foundation

5 years agortwn_pci(4): sync r88ee_power_on() with OpenBSD
avos [Fri, 4 Jan 2019 04:26:39 +0000 (04:26 +0000)]
rtwn_pci(4): sync r88ee_power_on() with OpenBSD

Tested with RTL8188EE, STA mode

Submitted by: Farhan Khan <khanzf@gmail.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18727

5 years agocxgbe(4): Clear FW_OK if the firmware reports an error.
np [Fri, 4 Jan 2019 04:15:17 +0000 (04:15 +0000)]
cxgbe(4): Clear FW_OK if the firmware reports an error.

Sponsored by: Chelsio Communications

5 years agogetopt_long(3): fix case of malformed long opt
kevans [Fri, 4 Jan 2019 03:13:24 +0000 (03:13 +0000)]
getopt_long(3): fix case of malformed long opt

When presented with an arg string like '-l-', getopt_long will successfully
parse out the 'l' short option, then proceed to match '--' against the first
longopts entry as it later does a strncmp with len=0. This latter bit is
arguably another bug in itself, but presumably not a practical issue as all
callers of parse_long_options are already doing the right thing (except this
one pointed out).

An opt string like '-l-' should be considered malformed and throw a bad
argument rather than behaving as if '--' were passed. It cannot possibly do
what the invoker expects, and it's probably the result of a typo (ls -l- a)
rather than any intent.

Reported by: Tony Overfield <toverfield@yahoo.com>
Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18616

5 years agoThe lam(1) man page is unclear about the uppercase versions of the flags
allanjude [Fri, 4 Jan 2019 02:48:43 +0000 (02:48 +0000)]
The lam(1) man page is unclear about the uppercase versions of the flags

PR: 229571
Submitted by: Tim Chase <freebsd@tim.thechases.com>

5 years agomp_ring: avoid items offset difference between iflib and mp_ring
mmacy [Thu, 3 Jan 2019 23:06:05 +0000 (23:06 +0000)]
mp_ring: avoid items offset difference between iflib and mp_ring
on architectures without 64-bit atomics

Reported by: Augustin Cavalier <waddlesplash@gmail.com>

5 years agozfsboot: support newer ZFS versions
mmacy [Thu, 3 Jan 2019 22:49:11 +0000 (22:49 +0000)]
zfsboot: support newer ZFS versions
declare v3 objset size/layout to fix userboot and possibly other loader issues

- fix for userboot assertion failure in zfs_dev_close in free due to out of bounds write
- fix for zfs_alloc / zfs_free mismatch assertion failure when booting GPT on BIOS

5 years agoAdd man page for dlvsym(3)
romain [Thu, 3 Jan 2019 21:31:17 +0000 (21:31 +0000)]
Add man page for dlvsym(3)

Add a short description of the function to the appropriate man page and add
reference to it where it makes sense.

Reviewed by: bcr, markj, 0mp
Approved by: markj
Differential Revision: https://reviews.freebsd.org/D18725

5 years agoloader.efi: efi variable rework and lsefi command added
tsoome [Thu, 3 Jan 2019 20:27:50 +0000 (20:27 +0000)]
loader.efi: efi variable rework and lsefi command added

This update does add diag and debug capabilities to interpret the efi
variables, configuration and protocols (lsefi).

The side effect is that we add/update bunch of related headers.

5 years agosh: Add test for exported but unset variables
jilles [Thu, 3 Jan 2019 20:23:12 +0000 (20:23 +0000)]
sh: Add test for exported but unset variables

PR: 233545

5 years agosh: Do not place exported but unset variables into the environment
jilles [Thu, 3 Jan 2019 20:22:35 +0000 (20:22 +0000)]
sh: Do not place exported but unset variables into the environment

PR: 233545
Submitted by: Jan Beich
Obtained from: NetBSD

5 years agoFix typo in r342710.
kib [Thu, 3 Jan 2019 19:35:07 +0000 (19:35 +0000)]
Fix typo in r342710.

Noted by: lidl
MFC after: 3 days

5 years agonetmap: unit tests: fix issues found by coverity scan
vmaffione [Thu, 3 Jan 2019 16:47:05 +0000 (16:47 +0000)]
netmap: unit tests: fix issues found by coverity scan

Reported by: asomers
MFC after: 1 week
Sponsored by: Sunny Valley Networks

5 years agoFix a use-after-free in the riscv pmap_release() implementation.
markj [Thu, 3 Jan 2019 16:26:52 +0000 (16:26 +0000)]
Fix a use-after-free in the riscv pmap_release() implementation.

Don't bother zeroing the top-level page before freeing it.  Previously,
the page was freed before being zeroed.

Reviewed by: jhb, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18720

5 years agoSynchronize access to the allpmaps list.
markj [Thu, 3 Jan 2019 16:24:03 +0000 (16:24 +0000)]
Synchronize access to the allpmaps list.

The list will be removed with some future work.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18721

5 years agoFix some issues with the riscv pmap_protect() implementation.
markj [Thu, 3 Jan 2019 16:21:44 +0000 (16:21 +0000)]
Fix some issues with the riscv pmap_protect() implementation.

- Handle VM_PROT_EXECUTE.
- Clear PTE_D and mark the page dirty when removing write access
  from a mapping.
- Atomically clear PTE_W to avoid clobbering a hardware PTE update.

Reviewed by: jhb, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18719

5 years agoSet PTE_U on PTEs created by pmap_enter_quick().
markj [Thu, 3 Jan 2019 16:19:32 +0000 (16:19 +0000)]
Set PTE_U on PTEs created by pmap_enter_quick().

Otherwise prefaulted entries are not accessible from user mode and
end up triggering a fault upon access, so prefaulting has no effect.

Reviewed by: jhb, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18718

5 years agoUse regular stores to update PTEs in the riscv pmap layer.
markj [Thu, 3 Jan 2019 16:15:28 +0000 (16:15 +0000)]
Use regular stores to update PTEs in the riscv pmap layer.

There's no need to use atomics when the previous value isn't needed.
No functional change intended.

Reviewed by: kib
Discussed with: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18717

5 years agoConfigure hz=100 in the QEMU target.
markj [Thu, 3 Jan 2019 16:11:21 +0000 (16:11 +0000)]
Configure hz=100 in the QEMU target.

We currently don't have a good way to dynamically detect whether the
kernel is running as a guest.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18715

5 years agoImprove USB generic debug messages. Print process ID and name when opening
hselasky [Thu, 3 Jan 2019 14:27:51 +0000 (14:27 +0000)]
Improve USB generic debug messages. Print process ID and name when opening
and closing usb/ugenX.Y character device nodes.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoloader.efi: update memmap command to recognize new attributes
tsoome [Thu, 3 Jan 2019 09:03:58 +0000 (09:03 +0000)]
loader.efi: update memmap command to recognize new attributes

Also move memory type to string translation to libefi for later use.

MFC after: 2 weeks

5 years agortwnfw(4): refresh this manpage too (add rtwn-rtl8188eefw module).
avos [Thu, 3 Jan 2019 03:27:37 +0000 (03:27 +0000)]
rtwnfw(4): refresh this manpage too (add rtwn-rtl8188eefw module).

MFC after: 3 days

5 years agoFix typo, use boolean operator instead of bit-wise.
kib [Thu, 3 Jan 2019 01:01:03 +0000 (01:01 +0000)]
Fix typo, use boolean operator instead of bit-wise.

Reviewed by: marius, shurd
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoi386_parsedev() needs to support fd devices
tsoome [Wed, 2 Jan 2019 20:31:15 +0000 (20:31 +0000)]
i386_parsedev() needs to support fd devices

MFC after: 2 weeks

5 years agortwn_usb(4): add USB id for TP-LINK TL-WN821N v5.
avos [Wed, 2 Jan 2019 18:35:40 +0000 (18:35 +0000)]
rtwn_usb(4): add USB id for TP-LINK TL-WN821N v5.

It is already mentioned in manpage, but was missing from the driver.

MFC after: 4 days

5 years agortwn(4): refresh manpages.
avos [Wed, 2 Jan 2019 18:30:22 +0000 (18:30 +0000)]
rtwn(4): refresh manpages.

- Add 'device rtwn' to rtwn_pci(4) and rtwn_usb(4) config sample;
kernel will not compile otherwise.
- Refresh devices list in rtwn_usb(4); add 'chipset' column.
- Bump Dd after this commit and r342682.

MFC after: 4 days

5 years agoFix an error check after r342699.
markj [Wed, 2 Jan 2019 17:34:25 +0000 (17:34 +0000)]
Fix an error check after r342699.

Reported by: gcc
MFC with: r342699
Sponsored by: The FreeBSD Foundation

5 years agortwn_pci(4): fix panic with INVARIANTS (due to inverted assertion logic)
avos [Wed, 2 Jan 2019 17:13:55 +0000 (17:13 +0000)]
rtwn_pci(4): fix panic with INVARIANTS (due to inverted assertion logic)

MFC after: 4 days

5 years agoCapsicumize savecore(8).
markj [Wed, 2 Jan 2019 17:09:35 +0000 (17:09 +0000)]
Capsicumize savecore(8).

- Use cap_fileargs(3) to open dump devices after entering capability
  mode, and use cap_syslog(3) to log messages.
- Use a relative directory fd to open output files.
- Use zdopen(3) to compress kernel dumps in capability mode.

Reviewed by: cem, oshogbo
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18458

5 years agoEscape a new line following r342283.
gjb [Wed, 2 Jan 2019 16:22:33 +0000 (16:22 +0000)]
Escape a new line following r342283.

Sponsored by: The FreeBSD Foundation

5 years agoTypo.
markj [Wed, 2 Jan 2019 16:01:54 +0000 (16:01 +0000)]
Typo.

Reported by: Christian Barthel
MFC after: 3 days

5 years agoUse g_handleattr() to reply to GEOM::candelete queries.
markj [Wed, 2 Jan 2019 15:52:16 +0000 (15:52 +0000)]
Use g_handleattr() to reply to GEOM::candelete queries.

g_handleattr() fills out bp->bio_completed; otherwise, g_getattr()
returns an error in response to the query.  This caused BIO_DELETE
support to not be propagated through stacked configurations, e.g.,
a gconcat of gmirror volumes would not handle BIO_DELETE even when
the gmirrors do.  g_io_getattr() was not affected by the problem.

PR: 232676
Reported and tested by: noah.bergbauer@tum.de
MFC after: 1 week

5 years agoAvoid setting PG_U unconditionally in pmap_enter_quick_locked().
markj [Wed, 2 Jan 2019 15:36:35 +0000 (15:36 +0000)]
Avoid setting PG_U unconditionally in pmap_enter_quick_locked().

This KPI may in principle be used to create kernel mappings, in which
case we certainly should not be setting PG_U.  In any case, PG_U must be
set on all layers in the page tables to grant user mode access, and we
were only setting it on leaf entries.  Thus, this change should have no
functional impact.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoRefresh sys/conf/files after recent rtwn(4) update.
avos [Wed, 2 Jan 2019 15:01:55 +0000 (15:01 +0000)]
Refresh sys/conf/files after recent rtwn(4) update.

MFC after: 4 days

5 years agortwn_pci(4): add support for RTL8188EE chipset.
avos [Wed, 2 Jan 2019 06:48:53 +0000 (06:48 +0000)]
rtwn_pci(4): add support for RTL8188EE chipset.

Initially based on https://reviews.freebsd.org/D15692;
later deduplicated and improved a bit (Tx reports, IQ calibration support).

Submitted by: Farhan Khan <khanzf@gmail.com>
MFC after: 4 days
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D15692

5 years agortwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E*
avos [Wed, 2 Jan 2019 06:03:19 +0000 (06:03 +0000)]
rtwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E*

MFC after: 4 days

5 years agortwn(4): rename common RTL8188E* structures.
avos [Wed, 2 Jan 2019 05:43:33 +0000 (05:43 +0000)]
rtwn(4): rename common RTL8188E* structures.

No functional change intended.

MFC after: 4 days

5 years agortwn(4): do not try to start RTL8188E* MCU during device shutdown.
avos [Wed, 2 Jan 2019 05:37:30 +0000 (05:37 +0000)]
rtwn(4): do not try to start RTL8188E* MCU during device shutdown.

MFC after: 4 days

5 years agoMove USB-specific parts from rtwn(4) to rtwn_usb(4)
avos [Wed, 2 Jan 2019 05:30:41 +0000 (05:30 +0000)]
Move USB-specific parts from rtwn(4) to rtwn_usb(4)

MFC after: 4 days

5 years agortwn_pci(4): add support for event-based Tx reports.
avos [Wed, 2 Jan 2019 05:21:06 +0000 (05:21 +0000)]
rtwn_pci(4): add support for event-based Tx reports.

It will be used for RTL8188EE (and, probably, others).

MFC after: 4 days

5 years agortwn_pci(4): use proper bus_dmamap_sync flags after Tx (sync with r342672)
avos [Wed, 2 Jan 2019 04:56:36 +0000 (04:56 +0000)]
rtwn_pci(4): use proper bus_dmamap_sync flags after Tx (sync with r342672)

MFC after: 4 days

5 years agortwn(4): drop obsolete comment + use 'nop' function for 92eu calibration
avos [Wed, 2 Jan 2019 04:27:39 +0000 (04:27 +0000)]
rtwn(4): drop obsolete comment + use 'nop' function for 92eu calibration

RTL8192EU was not tested with previously added code.

MFC after: 4 days

5 years agortwn(4): add IQ calibration support for RTL8188E*
avos [Wed, 2 Jan 2019 04:19:28 +0000 (04:19 +0000)]
rtwn(4): add IQ calibration support for RTL8188E*

Tested with:
 * RTL8188EE, STA mode.
 * RTL8188EU, STA mode.

MFC after: 4 days

5 years agortwn(4): provide register definitions for RTL8188CE calibration routines.
avos [Wed, 2 Jan 2019 04:08:37 +0000 (04:08 +0000)]
rtwn(4): provide register definitions for RTL8188CE calibration routines.

No functional change intended.

MFC after: 4 days

5 years agortwn_pci: fix excessive packet loss on Tx with RTL8188EE.
avos [Tue, 1 Jan 2019 23:41:16 +0000 (23:41 +0000)]
rtwn_pci: fix excessive packet loss on Tx with RTL8188EE.

Use proper flags for bus_dmamap_sync() in Tx path.

Tested with: RTL8188EE, STA mode

MFC after: 4 days

5 years agortld-elf: Fix powerpc64 TLS handling, matching powerpc's fix
jhibbits [Tue, 1 Jan 2019 20:12:58 +0000 (20:12 +0000)]
rtld-elf: Fix powerpc64 TLS handling, matching powerpc's fix

We need to subtract the TLS_TCB_SIZE to get to the real data pointer, since
r13 points to the end of the TCB structure.  Prior to this, devel/protobuf-c
port broke with recent update to devel/protobuf, which exposed this issue.

Submitted by: andreast
Reported by: Piotr Kubaj
MFC after: 1 week

5 years agolinuxkpi: Remove extraneous NULL check on M_WAITOK allocation
cem [Tue, 1 Jan 2019 19:56:49 +0000 (19:56 +0000)]
linuxkpi: Remove extraneous NULL check on M_WAITOK allocation

The check was not introduced in r342628, but the subsequent unchecked access to
refs was added then, prompting a Coverity warning about "Null pointer
dereferences (FORWARD_NULL)."  The warning is bogus due to M_WAITOK, but so is
the NULL check that hints it, so just remove it.

CID: 1398588
Reported by: Coverity

5 years agoUpdate the efibootmgr(8) man page to document changes to options.
bcran [Tue, 1 Jan 2019 04:57:46 +0000 (04:57 +0000)]
Update the efibootmgr(8) man page to document changes to options.

5 years agoHappy New Year 2019!
delphij [Tue, 1 Jan 2019 00:25:25 +0000 (00:25 +0000)]
Happy New Year 2019!

5 years agoPort over the SCSI sense handling fix from mpr(4) in r342528, and fix
scottl [Mon, 31 Dec 2018 23:30:31 +0000 (23:30 +0000)]
Port over the SCSI sense handling fix from mpr(4) in r342528, and fix
whitespace to match.

5 years agoFix whitespace from r342528
scottl [Mon, 31 Dec 2018 23:27:56 +0000 (23:27 +0000)]
Fix whitespace from r342528

5 years agoCorrect variable name in two panic messages: num_msi_irq -> num_msi_irqs.
jhb [Mon, 31 Dec 2018 22:46:43 +0000 (22:46 +0000)]
Correct variable name in two panic messages: num_msi_irq -> num_msi_irqs.

MFC after: 1 week

5 years agoAdd NO_RC16 quirk for Chipfancier 16GB USB stick...
imp [Mon, 31 Dec 2018 22:20:30 +0000 (22:20 +0000)]
Add NO_RC16 quirk for Chipfancier 16GB USB stick...

Submitted by: osef.lar@gmail.com
PR: 234503

5 years agoMore references to pmap_cold().
kib [Mon, 31 Dec 2018 18:11:04 +0000 (18:11 +0000)]
More references to pmap_cold().

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoUpdate comments: paging is initialized in pmap_cold().
kib [Mon, 31 Dec 2018 18:05:48 +0000 (18:05 +0000)]
Update comments: paging is initialized in pmap_cold().

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoSupport the SPI mode and bus clock frequency parameters set by the devices
ian [Mon, 31 Dec 2018 16:01:22 +0000 (16:01 +0000)]
Support the SPI mode and bus clock frequency parameters set by the devices
requesting SPI transfers.

Reported by: SAITOU Toshihide <toshi@ruby.ocn.ne.jp>

5 years agomsun: Fix some old typos.
pfg [Mon, 31 Dec 2018 15:43:06 +0000 (15:43 +0000)]
msun: Fix some old typos.

Seen in a posting from July 27 by "CM Graff" in musl-libc.

5 years agonetmap: fix warnings on unit tests
vmaffione [Mon, 31 Dec 2018 12:07:17 +0000 (12:07 +0000)]
netmap: fix warnings on unit tests

Fix some printf() format string warnings raised for ctrl-api-test.c
on some architectures.

MFC after: 1 week
Sponsored by: Sunny Valley Networks

5 years agonetmap: add suite of unit tests
vmaffione [Mon, 31 Dec 2018 11:17:58 +0000 (11:17 +0000)]
netmap: add suite of unit tests

Import the unit tests from upstream (https://github.com/luigirizzo/netmap
ba02539859d46d33), and make them ready for use with Kyua.
There are currently 38 regression tests, which test the kernel control ABI
exposed by netmap to userspace applications:

  1: test for port info get
  2-5: tests for basic port registration
  6-9: tests for VALE
  10-11: tests for getting netmap allocator info
  12-15: tests for netmap pipes
  16: test on polling mode
  17-18: tests on options
  19-27: tests for sync-kloop subsystem
  28-39: tests for null ports
  31-38: tests for the legacy NIOCREGIF registers

Reviewed by: ngie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18490

5 years agoAdd current working directory to the default (although commented out) sh(1)
trasz [Mon, 31 Dec 2018 10:17:42 +0000 (10:17 +0000)]
Add current working directory to the default (although commented out) sh(1)
prompt, so it looks just like the tcsh(1) one when you uncomment it.

Reviewed by: jilles
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18673

5 years agoImport tzdata 2018i
philip [Mon, 31 Dec 2018 07:57:37 +0000 (07:57 +0000)]
Import tzdata 2018i

Changes: https://github.com/eggert/tz/blob/2018i/NEWS

MFC after: 2 days

5 years agoEnsure buffer is nul-terminated.
delphij [Mon, 31 Dec 2018 03:08:01 +0000 (03:08 +0000)]
Ensure buffer is nul-terminated.

MFC after: 2 weeks

5 years agoWhen allocating a new keyboard at vt_upgrade() time, unwind any cngrabs
ian [Mon, 31 Dec 2018 01:09:23 +0000 (01:09 +0000)]
When allocating a new keyboard at vt_upgrade() time, unwind any cngrabs
done on the old keyboard and then do the corresponding number of grabs
on the new keyboard.

This fixes a race that can leave the system with a non-functioning
keyboard.  It goes like this...

 - The bios claims there is an AT keyboard, atkbd attaches.
 - SI_SUB_INT_CONFIG_HOOKS runs.
 - USB probes devices. Devices begin attaching, including disks.
 - GELI prompts for a password for a just-attached disk, which results
   in a cngrab() while atkbd is the keyboard.
 - A USB keyboard attaches.
 - vt_upgrade() runs and switches the keyboard to the new USB keyboard,
   but because cngrab was never called for it, it's not activated and
   keystrokes are ignored.
 - Now there is no functional keyboard and no way to get one; even
   plugging in a different USB keyboard doesn't help, because the console
   is still grabbed, still waiting for a GELI pw.

Discussed with:      ray@

5 years agoUse the --activate efibootmgr(8) flag when creating entries in bootconfig
bcran [Mon, 31 Dec 2018 00:26:35 +0000 (00:26 +0000)]
Use the --activate efibootmgr(8) flag when creating entries in bootconfig

Sponsored by: Netflix

5 years agoFix ESP generation when using a gmirror, and when booting from RO medium
bcran [Mon, 31 Dec 2018 00:20:58 +0000 (00:20 +0000)]
Fix ESP generation when using a gmirror, and when booting from RO medium

When using a gmirror, entries in /dev can be removed. So instead of using
kern.disks, get the list of disks from "gpart status -sg" instead.

We assume that any 'efi' partition that can't be mounted as msdosfs should
be used as an ESP. However, the ESP on the CD/DVD can't be mounted read-write
and so was being treated as if unformatted. Try the mount as read-only
instead, to catch cases like this.

Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18645

5 years agoAdd UPDATING entry for r342635.
bcran [Mon, 31 Dec 2018 00:15:05 +0000 (00:15 +0000)]
Add UPDATING entry for r342635.

Sponsored by: Netflix

5 years agoChange the way efibootmgr works by specifying bootnum via -b parameter
bcran [Mon, 31 Dec 2018 00:09:45 +0000 (00:09 +0000)]
Change the way efibootmgr works by specifying bootnum via -b parameter

Instead of passing the bootnum to each different parameter, require users
to specify -b when running operations that need a bootnum.

This allows activation of a new boot entry at the same time it's created
by adding -a onto the command line.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18648

5 years agoo Don't allocate resources for SDMA in sdhci(4) if the controller or the
marius [Sun, 30 Dec 2018 23:08:06 +0000 (23:08 +0000)]
o Don't allocate resources for SDMA in sdhci(4) if the controller or the
  front-end doesn't support SDMA or the latter implements a platform-
  specific transfer method instead. While at it, factor out allocation
  and freeing of SDMA resources to sdhci_dma_{alloc,free}() in order to
  keep the code more readable when adding support for ADMA variants.

o Base the size of the SDMA bounce buffer on MAXPHYS up to the maximum
  of 512 KiB instead of using a fixed 4-KiB-buffer. With the default
  MAXPHYS of 128 KiB and depending on the controller and medium, this
  reduces the number of SDHCI interrupts by a factor of ~16 to ~32 on
  sequential reads while an increase of throughput of up to ~84 % was
  seen.

  Front-ends for broken controllers that only support an SDMA buffer
  boundary of a specific size may set SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY
  and supply a size via struct sdhci_slot. According to Linux, only
  Qualcomm MSM-type SDHCI controllers are affected by this, though.

  Requested by: Shreyank Amartya (unconditional bump to 512 KiB)

o Introduce a SDHCI_DEPEND macro for specifying the dependency of the
  front-end modules on the sdhci(4) one and bump the module version
  of sdhci(4) to 2 via an also newly introduced SDHCI_VERSION in order
  to ensure that all components are in sync WRT struct sdhci_slot.

o In sdhci(4):
  - Make pointers const were applicable,
  - replace a few device_printf(9) calls with slot_printf() for
    consistency, and
  - sync some local functions with their prototypes WRT static.

5 years agoFix various issues with Chinese locales:
delphij [Sun, 30 Dec 2018 23:04:02 +0000 (23:04 +0000)]
Fix various issues with Chinese locales:

 - Change short weekday names to use only one Chinese character.
   (note: this is a somewhat misunfortunate compromise due to the fact
   that some applications are using short buffer for weekday names,
   and in ~1905 when 星期 system was created to replace the traditional
   七曜 system, which can use 日月火水木金土 to represent Sunday through
   Saturday with just one character without any confusion).
 - for zh_CN locales: use Arabic numerals for month names, matching the
   practice of all other CJK locales
 - Regenerate zh_CN.{GB2312,GBK} locales from zh_CN.UTF-8.

Reported by: ygy
Reviewed by: kevlo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18689

5 years agoext2fs.5: Update the manpage.
pfg [Sun, 30 Dec 2018 19:44:50 +0000 (19:44 +0000)]
ext2fs.5: Update the manpage.

General update of the driver description and mention some important credits.
Add a symlink for ext4fs as it is of special interest nowadays.

Fic some `mandoc -Tlint` issues while here.

MFC after: 15 days
Differential Revision: https://reviews.freebsd.org/D18445

5 years agoFix 32bit gcc builds after r342625.
kib [Sun, 30 Dec 2018 16:39:26 +0000 (16:39 +0000)]
Fix 32bit gcc builds after r342625.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd 'v' modifier to the ddb 'show pginfo' command to display vm_page
kib [Sun, 30 Dec 2018 15:58:18 +0000 (15:58 +0000)]
Add 'v' modifier to the ddb 'show pginfo' command to display vm_page
backing the provided kernel virtual address.

Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoBump __FreeBSD_version since r342628 changed size of struct linux_cdev
kib [Sun, 30 Dec 2018 15:55:30 +0000 (15:55 +0000)]
Bump __FreeBSD_version since r342628 changed size of struct linux_cdev
on tier-1 i386 architecture.

Requested by: hselasky
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix linux_destroy_dev() behaviour when there are still files open from
kib [Sun, 30 Dec 2018 15:46:45 +0000 (15:46 +0000)]
Fix linux_destroy_dev() behaviour when there are still files open from
the destroying cdev.

Currently linux_destroy_dev() waits for the reference count on the
linux cdev to drain, and each open file hold the reference.
Practically it means that linux_destroy_dev() is blocked until all
userspace processes that have the cdev open, exit.  FreeBSD devfs does
not have such problem, because device refcount only prevents freeing
of the cdev memory, and separate 'active methods' counter blocks
destroy_dev() until all threads leave the cdevsw methods.  After that,
attempts to enter cdevsw methods are refused with an error.

Implement somewhat similar mechanism for LinuxKPI cdevs.  Demote cdev
refcount to only mean a hold on the linux cdev memory.  Add sirefs
count to track both number of threads inside the cdev methods, and for
single-bit indicator that cdev is being destroyed.  In the later case,
the call is redirected to the dummy cdev.

Reviewed by: markj
Discussed with: hselasky
Tested by: zeising
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D18606

5 years agoImplement zap_vma_ptes() for managed device objects.
kib [Sun, 30 Dec 2018 15:38:07 +0000 (15:38 +0000)]
Implement zap_vma_ptes() for managed device objects.

Reviewed by: markj
Discussed with: hselasky
Tested by: zeising
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D18606

5 years agoAdd Copyright.
tsoome [Sun, 30 Dec 2018 15:34:12 +0000 (15:34 +0000)]
Add Copyright.

Reported by: Rodney W. Grimes

5 years agoUse IDX_TO_OFF().
kib [Sun, 30 Dec 2018 15:28:31 +0000 (15:28 +0000)]
Use IDX_TO_OFF().

Reviewed by: markj
Discussed with: hselasky
Tested by: zeising
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D18606

5 years agoloader: create bio_alloc and bio_free for bios bounce buffer
tsoome [Sun, 30 Dec 2018 09:35:47 +0000 (09:35 +0000)]
loader: create bio_alloc and bio_free for bios bounce buffer

We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement
bio_alloc()/bio_free() interface to make it possible to use this space for
other BIOS calls (notably, from biosdisk.c).

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17131

5 years agoProperly set svn:mimetype for zh_CN.UTF-8.src.
delphij [Sun, 30 Dec 2018 08:30:11 +0000 (08:30 +0000)]
Properly set svn:mimetype for zh_CN.UTF-8.src.

MFC after: 2 weeks

5 years agoImport tzdata 2018h
philip [Sun, 30 Dec 2018 08:22:35 +0000 (08:22 +0000)]
Import tzdata 2018h

Changes: https://github.com/eggert/tz/blob/2018h/NEWS

MFC after: 3 days

5 years agoMove ASSERT_VOP_LOCKED to top of ufs_vinit() as it should be true
mckusick [Sun, 30 Dec 2018 06:03:20 +0000 (06:03 +0000)]
Move ASSERT_VOP_LOCKED to top of ufs_vinit() as it should be true
when the function is entered.

Suggested by: kib

5 years agoFor consistency with FFS2's fifoops2 and both versions of FFS's
mckusick [Sun, 30 Dec 2018 05:03:41 +0000 (05:03 +0000)]
For consistency with FFS2's fifoops2 and both versions of FFS's
vnodeops make FFS1's fifoops1 use ffs_lock. Also delete ffs_reallocblks
from fifoops1 which is needed only for fifoops2 because of its
support for extended attributes that need to allocate blocks.

Suggested by: kib

5 years agoTCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
cy [Sun, 30 Dec 2018 04:25:48 +0000 (04:25 +0000)]
TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header
isn't included explicitly or implicitly at this point therefore
as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove
the #ifdef and include netinet/tcp.h unconditionally.

MFC after: 1 week

5 years agonet80211: fix duplicate sequence number bump for non-AMPDU QoS frames.
avos [Sun, 30 Dec 2018 03:03:53 +0000 (03:03 +0000)]
net80211: fix duplicate sequence number bump for non-AMPDU QoS frames.

This should be a part of r312972.

MFC after: 4 days