Commit Graph

122180 Commits

Author SHA1 Message Date
Andriy Gapon
40e7b06492 uchcom: reject parity and double stop bits as unsupported
Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 21:00:13 +00:00
Andriy Gapon
7acd73fd1e uchcom: add a hardware configuration tweak seen in Linux code
Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 20:59:15 +00:00
Andriy Gapon
1d33c9a55f uchcom: add DPRINTF-s to aid debugging of the driver
Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 20:58:06 +00:00
Andriy Gapon
d759c295c1 uchcom: report detected product based on USB product ID
Product IDs are specified in vendor documents.  The previously used
device ID is not.  This is a cosmetic change.  No functionality depends
on those IDs.

Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 20:57:14 +00:00
Jean-Sébastien Pédron
b554075d14 teken: Rename the "Set Cursor Style" sequence to match vt100.net docs
This fixes inconsistencies with the rest of the `sequences` file.

No functional changes.

Requested by:	ed
2018-05-21 20:35:16 +00:00
Andriy Gapon
27dca831a6 stop and restart kernel event timers in the suspend / resume cycle
I have a system that is very unstable after resuming from suspend-to-RAM
but only if HPET is used as the event timer.  The theory is that SMM
code / firmware could be enabling HPET for its own uses and unexpected
interrupts cause a trouble for it.  Originally I wanted to solve the
problem in hpet_suspend() method, but that was insufficient as the event
timer could get reprogrammed again.

So, it's better, for my case and in general, to stop the event timer(s)
before entering the hardware suspend.

MFC after:	4 weeks
Differential Revision: https://reviews.freebsd.org/D15413
2018-05-21 20:23:04 +00:00
Konstantin Belousov
5988464ec4 Fix grammar.
Submitted by:	alc
MFC after:	1 week
2018-05-21 19:15:05 +00:00
Konstantin Belousov
0a4b04a616 Add missed barrier for pm_gen/pm_active interaction.
When we issue shootdown IPIs, we first assign zero to pm_gens to
indicate the need to flush on the next context switch in case our IPI
misses the context, next we read pm_active. On context switch we set
our bit in pm_active, then we read pm_gen. It is crucial that both
threads see the memory in the program order, otherwise invalidation
thread might read pm_active bit as zero and the context switching
thread might read pm_gen as zero.

IA32 allows CPU for both reads to see zero. We must use the barriers
between write and read. The pm_active bit set is already locked, so
only the invalidation functions need it.

I never saw it in real life, or at least I do not have a good
reproduction case. I found this during code inspection when hunting
for the Xen TLB issue reported by cperciva.

Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D15506
2018-05-21 18:41:16 +00:00
Edward Tomasz Napierala
733efc21c4 Add a somewhat ugly hack that makes OSX serial device node names
human-readable.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-21 17:33:52 +00:00
Edward Tomasz Napierala
ac4a7f30d2 Improve description strings for USB device-mode serial ports.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-21 16:33:13 +00:00
Andrey V. Elsukov
4bb8a5b0c9 Remove check for matching the rulenum, ruleid and rule pointer from
dyn_lookup_ipv[46]_state_locked(). These checks are remnants of not
ready to be committed code, and they are there by accident.
Due to the race these checks can lead to creating of duplicate states
when concurrent threads in the same time will try to add state for two
packets of the same flow, but in reverse directions and matched by
different parent rules.

Reported by:	lev
MFC after:	3 days
2018-05-21 16:19:00 +00:00
Andrew Turner
78921ae879 Restrict the faulting addresses we call pmap_fault from to just those that
may fault due to superpage mappings being changed.

Sponsored by:	DARPA, AFRL
2018-05-21 16:14:53 +00:00
Matt Macy
f42a83f2a6 inpcb: revert deferred inpcb free pending further review 2018-05-21 16:13:43 +00:00
Mark Johnston
13679ebac9 Don't pass a section cookie to CK for non-preemptible epoch sections.
They're only useful when multiple threads may share an epoch record,
and that can't happen with non-preemptible sections.

Reviewed by:	mmacy
Differential Revision:	https://reviews.freebsd.org/D15507
2018-05-21 16:03:51 +00:00
Edward Tomasz Napierala
d01c1c8bfe Use USB Vendor Identifiers and Product Identifiers provided by V-USB
(https://github.com/obdev/v-usb/blob/master/usbdrv/USB-IDs-for-free.txt).
Previously we were using an invalid (not assigned to us) VID.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-21 15:06:19 +00:00
Michael Tuexen
c692df45fc Only fillin data srucuture when actually stored. 2018-05-21 14:53:22 +00:00
Michael Tuexen
d3132db2b5 Do the appropriate accounting when ip_output() fails. 2018-05-21 14:52:18 +00:00
Michael Tuexen
95844fce7d Make clear why there is an assignment, which is not necessary. 2018-05-21 14:51:20 +00:00
Ed Maste
3b9b6b1704 Pair CURVNET_SET and CURVNET_RESTORE in a block
Per vnet(9), CURVNET_SET and CURVNET_RESTORE cannot be used as a single
statement for a conditional and CURVNET_RESTORE must be in the same
block as CURVNET_SET (or a subblock).

Reviewed by:	andrew
Sponsored by:	The FreeBSD Foundation
2018-05-21 13:08:44 +00:00
Ed Maste
15f8acc53f Revert r333968, it broke all archs but i386 and amd64 2018-05-21 11:56:07 +00:00
Matt Macy
ed6bb714b2 in(6)_mcast: Expand out vnet set / restore macro so that they work in a conditional block
Reported by:	zec at fer.hr
2018-05-21 08:34:10 +00:00
Matt Macy
06b15160e1 ensure that vnet is set when doing in_leavegroup 2018-05-21 07:12:06 +00:00
Mateusz Guzik
edacda736b amd64: annotate pti with __read_frequently 2018-05-21 05:20:23 +00:00
Matt Macy
fd04260d3f ck: simplify interface with libkvm consumers by defining ck_queue types
as their queue.h equivalents if !_KERNEL
2018-05-21 01:53:23 +00:00
Matt Macy
9725c9cef7 AF_UNIX gc unused label
...sigh
2018-05-20 21:37:34 +00:00
Matt Macy
cb8f450b94 AF_UNIX: Don't unlock unp/unp2 if they're not locked
Reported by:	mjg
2018-05-20 21:20:26 +00:00
Matt Macy
b15253bba0 make sure vnet is set when freeing
Reported by:	pho
2018-05-20 20:48:26 +00:00
Matt Macy
ae573a91cf pmc: detach free_gtask on unload
Reported by:	pho
2018-05-20 20:34:15 +00:00
Matt Macy
1a3d880c26 in(s)_moptions: free before tearing down inpcb 2018-05-20 20:08:21 +00:00
Matt Macy
f2daab2c8f pmc: avoid potential race on shutdown
Clear shutdown flag first, conservatively allow 5ms for all hardclock consumers to
see flag before drainining
2018-05-20 19:35:24 +00:00
Nathan Whitehorn
6cff19a3be Fix build with PSERIES but not POWERNV defined. 2018-05-20 18:26:09 +00:00
Jean-Sébastien Pédron
8dcd2ed3c9 teken, vt(4): Parse the "Cursor style" escape sequence
The escape sequence (e.g. `^[[2 q`) was unsupported before and the
letter `q` was displayed as a typed character. The sequence is used by
Neovim for instance.

Now, it is properly parsed. However, it is ignored, so it won't change
the cursor style.

Because the escape sequence contains a space character, the
`gensequences` script had to be modified to support that. In the
`sequences` file, a space is represented as the string `SP`.
2018-05-20 14:21:20 +00:00
Matt Macy
b7faa59dee nfsclient: warnings cleanups 2018-05-20 06:14:12 +00:00
Matt Macy
e10ef65d23 AF_UNIX: fix LOR introduced by the locking rewrite 2018-05-20 05:50:53 +00:00
Matt Macy
7118990962 Add additional preinitialized cap_rights 2018-05-20 05:13:12 +00:00
Mateusz Guzik
2186ee6e72 vfs: simplify vop_stdlock/unlock
The interlock pointer is non-NULL by definition and the compiler see through
that and eliminates the NULL checks. Just remove them from the code as they
play no role.

No difference in generated assembly.
2018-05-20 04:45:05 +00:00
Matt Macy
47d2a58560 inpcb: defer destruction of inpcb until after a grace period has elapsed
in_pcbfree will remove the incpb from the list and release the rtentry
while the vnet is set, but the actual destruction will be deferred
until any threads in a (not yet used) epoch section, no longer potentially
have references.
2018-05-20 04:38:04 +00:00
Matt Macy
d95253403f AF_UNIX: make unpcb lock name line up with what's in witness 2018-05-20 04:32:48 +00:00
Matt Macy
ce8054a08f epoch.h: hide proc.h->priority.h from user 2018-05-20 04:15:12 +00:00
Justin Hibbits
ef6da5e5c7 Add support for the XIVE XICS emulation mode for POWER9 systems
Summary:
POWER9 systems use a new interrupt controller, XIVE, managed through OPAL
firmware calls.  The OPAL firmware includes support for emulating the previous
generation XICS presentation layer in addition to a new "XIVE Exploitation"
mode.  As a stopgap until we have XIVE exploitation mode, enable XICS emulation
mode so that we at least have an interrupt controller.

Since the CPPR is local to the current CPU, it cannot be updated for APs when
initializing on the BSP.  This adds a new function, directly called by the
powernv platform code, to initialize the CPPR on AP bringup.

Reviewed by:	nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15492
2018-05-20 03:23:17 +00:00
Matt Macy
056b40e29c inpcb: consolidate possible deletion in pcblist functions in to epoch
deferred context.
2018-05-20 02:27:58 +00:00
Matt Macy
ddece765f3 in_pcb: add helper for deferring inpcb rele calls from list functions 2018-05-20 02:17:30 +00:00
Matt Macy
5d9bb5d96d epoch.h: move kernel only bits under _KERNEL 2018-05-20 01:00:56 +00:00
Matt Macy
cb6bb2303e ip(6)_freemoptions: defer imo destruction to epoch callback task
Avoid the ugly unlock / lock of the inpcbinfo where we need to
figure out what kind of lock we hold by simply deferring the
operation to another context. (Also a small dependency for
converting the pcbinfo read lock to epoch)
2018-05-20 00:22:28 +00:00
Mark Johnston
23d123c6cf Use the canonical check for reservation support. 2018-05-19 23:49:13 +00:00
Nathan Whitehorn
4f75b93007 Avoid writing to the frame buffer in early boot on PowerPC if the CPU's
MMU is disabled.

This expands some earlier logic and avoids a number of potential problems:
1. The CPU may not be able to access the framebuffer in real mode (real
   mode does not necessarily encompass all available memory, especially
   under a hypervisor).
2. Real mode accesses generally assume cacheability, so it might not
   even have worked.
3. The difference in cacheability between real mode and later (and
   potentially earlier) points in the boot with the MMU on may cause
   ERAT parity problems, resulting in a machine check.

This fixes real-mode (usefdt=1) early boot on the G5 iMac, which was
previously broken as a result of issue #3. Late boot will require some
other fixups.
2018-05-19 22:04:54 +00:00
Konstantin Belousov
ba6ce3a34b Style.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-05-19 21:36:55 +00:00
Konstantin Belousov
45c228cc29 Fix PCID+PTI pmap operations on Xen/HVM.
Install appropriate pti-aware shootdown IPI handlers, otherwise user
page tables do not get enough invalidations.  The non-pti handlers
were used so far.

Reported and tested by:	cperciva
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-05-19 20:28:59 +00:00
Konstantin Belousov
7c25320c69 Fix IBRS handling around MWAIT.
The intent was to disable IBPB and IBRS around MWAIT, and re-enable on
the sleep end.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-05-19 20:26:33 +00:00
Mark Johnston
892bdccca0 Enable kernel dump features in GENERIC for most platforms.
This turns on support for kernel dump encryption and compression, and
netdump. arm and mips platforms are omitted for now, since they are more
constrained and don't benefit as much from these features.

Reviewed by:	cem, manu, rgrimes
Tested by:	manu (arm64)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D15465
2018-05-19 19:53:23 +00:00