Commit Graph

125452 Commits

Author SHA1 Message Date
Conrad Meyer
33c80c7cc2 Bump __FreeBSD_version for r342771 2019-01-04 18:34:44 +00:00
Conrad Meyer
6b83069e05 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
2019-01-04 18:31:17 +00:00
David Bright
98ae4866ba 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
2019-01-04 18:21:49 +00:00
Konstantin Belousov
0598e55ea3 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
2019-01-04 17:33:07 +00:00
Mark Johnston
2f2ddd68a5 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
2019-01-04 17:31:50 +00:00
Konstantin Belousov
f0d85a5dc5 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
2019-01-04 17:25:47 +00:00
Mark Johnston
23732c0fe3 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
2019-01-04 17:14:50 +00:00
Mark Johnston
c1959ba49b 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
2019-01-04 17:10:16 +00:00
Mark Johnston
b679dc7fee 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
2019-01-04 17:08:45 +00:00
Ed Maste
feea78990c 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
2019-01-04 16:47:35 +00:00
Ed Maste
2cb541bf69 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
2019-01-04 14:42:36 +00:00
Andriy Voskoboinyk
48f21a05da 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
2019-01-04 04:26:39 +00:00
Navdeep Parhar
1a35ae9353 cxgbe(4): Clear FW_OK if the firmware reports an error.
Sponsored by:	Chelsio Communications
2019-01-04 04:15:17 +00:00
Matt Macy
5881181d8c mp_ring: avoid items offset difference between iflib and mp_ring
on architectures without 64-bit atomics

Reported by:	Augustin Cavalier <waddlesplash@gmail.com>
2019-01-03 23:06:05 +00:00
Matt Macy
27e05a1902 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
2019-01-03 22:49:11 +00:00
Konstantin Belousov
d3f4030708 Fix typo in r342710.
Noted by:	lidl
MFC after:	3 days
2019-01-03 19:35:07 +00:00
Mark Johnston
7c59ec14e6 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
2019-01-03 16:26:52 +00:00
Mark Johnston
bad66a29d4 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
2019-01-03 16:24:03 +00:00
Mark Johnston
60af34002e 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
2019-01-03 16:21:44 +00:00
Mark Johnston
8ccaccd522 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
2019-01-03 16:19:32 +00:00
Mark Johnston
619999ff9f 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
2019-01-03 16:15:28 +00:00
Mark Johnston
7b1e32a5be 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
2019-01-03 16:11:21 +00:00
Hans Petter Selasky
fdb955f51f 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
2019-01-03 14:27:51 +00:00
Konstantin Belousov
85f3b801e9 Fix typo, use boolean operator instead of bit-wise.
Reviewed by:	marius, shurd
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-01-03 01:01:03 +00:00
Andriy Voskoboinyk
920dfe026c 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
2019-01-02 18:35:40 +00:00
Andriy Voskoboinyk
0fe1808c72 rtwn_pci(4): fix panic with INVARIANTS (due to inverted assertion logic)
MFC after:	4 days
2019-01-02 17:13:55 +00:00
Mark Johnston
438622af06 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
2019-01-02 15:52:16 +00:00
Mark Johnston
9bfc7fa41d 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
2019-01-02 15:36:35 +00:00
Andriy Voskoboinyk
1dbb72e9e8 Refresh sys/conf/files after recent rtwn(4) update.
MFC after:	4 days
2019-01-02 15:01:55 +00:00
Andriy Voskoboinyk
b3f3786e5d 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
2019-01-02 06:48:53 +00:00
Andriy Voskoboinyk
a163403b62 rtwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E*
MFC after:	4 days
2019-01-02 06:03:19 +00:00
Andriy Voskoboinyk
0db82209dc rtwn(4): rename common RTL8188E* structures.
No functional change intended.

MFC after:	4 days
2019-01-02 05:43:33 +00:00
Andriy Voskoboinyk
44c68782f1 rtwn(4): do not try to start RTL8188E* MCU during device shutdown.
MFC after:	4 days
2019-01-02 05:37:30 +00:00
Andriy Voskoboinyk
4e4bcfcfb7 Move USB-specific parts from rtwn(4) to rtwn_usb(4)
MFC after:	4 days
2019-01-02 05:30:41 +00:00
Andriy Voskoboinyk
17d5fbf21b rtwn_pci(4): add support for event-based Tx reports.
It will be used for RTL8188EE (and, probably, others).

MFC after:	4 days
2019-01-02 05:21:06 +00:00
Andriy Voskoboinyk
b5a81dd4c5 rtwn_pci(4): use proper bus_dmamap_sync flags after Tx (sync with r342672)
MFC after:	4 days
2019-01-02 04:56:36 +00:00
Andriy Voskoboinyk
5be70ac877 rtwn(4): drop obsolete comment + use 'nop' function for 92eu calibration
RTL8192EU was not tested with previously added code.

MFC after:	4 days
2019-01-02 04:27:39 +00:00
Andriy Voskoboinyk
58d3c148fd rtwn(4): add IQ calibration support for RTL8188E*
Tested with:
 * RTL8188EE, STA mode.
 * RTL8188EU, STA mode.

MFC after:	4 days
2019-01-02 04:19:28 +00:00
Andriy Voskoboinyk
db70ff37a0 rtwn(4): provide register definitions for RTL8188CE calibration routines.
No functional change intended.

MFC after:	4 days
2019-01-02 04:08:37 +00:00
Andriy Voskoboinyk
387c3f1495 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
2019-01-01 23:41:16 +00:00
Conrad Meyer
85f2a00b34 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
2019-01-01 19:56:49 +00:00
Xin LI
6af306e6f3 Happy New Year 2019! 2019-01-01 00:25:25 +00:00
Scott Long
808a5e94da Port over the SCSI sense handling fix from mpr(4) in r342528, and fix
whitespace to match.
2018-12-31 23:30:31 +00:00
Scott Long
e94a449387 Fix whitespace from r342528 2018-12-31 23:27:56 +00:00
John Baldwin
a230c2f1b3 Correct variable name in two panic messages: num_msi_irq -> num_msi_irqs.
MFC after:	1 week
2018-12-31 22:46:43 +00:00
Warner Losh
e11ed26a1d Add NO_RC16 quirk for Chipfancier 16GB USB stick...
Submitted by: osef.lar@gmail.com
PR: 234503
2018-12-31 22:20:30 +00:00
Konstantin Belousov
3c72855616 More references to pmap_cold().
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2018-12-31 18:11:04 +00:00
Konstantin Belousov
e68d443853 Update comments: paging is initialized in pmap_cold().
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2018-12-31 18:05:48 +00:00
Ian Lepore
584e31851a 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>
2018-12-31 16:01:22 +00:00
Ian Lepore
1cc7e361a6 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@
2018-12-31 01:09:23 +00:00