]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMerge llvm, clang, lld and lldb trunk r300890, and update build glue.
dim [Thu, 20 Apr 2017 21:48:54 +0000 (21:48 +0000)]
Merge llvm, clang, lld and lldb trunk r300890, and update build glue.

7 years agoVendor import of clang trunk r300890:
dim [Thu, 20 Apr 2017 21:20:51 +0000 (21:20 +0000)]
Vendor import of clang trunk r300890:
https://llvm.org/svn/llvm-project/cfe/trunk@300890

7 years agoMerge ^/head r316992 through r317215.
dim [Thu, 20 Apr 2017 21:04:21 +0000 (21:04 +0000)]
Merge ^/head r316992 through r317215.

7 years agoAdd function and data sections when building llvm, clang, lld and lldb,
dim [Thu, 20 Apr 2017 21:00:09 +0000 (21:00 +0000)]
Add function and data sections when building llvm, clang, lld and lldb,
and allow the linker to garbage collect them.  This shaves off up to a
few MB from the final executables.

MFC after: 3 days

7 years agoTurn off llvm/clang's ENABLE_BACKTRACES setting, since it never worked
dim [Thu, 20 Apr 2017 21:00:04 +0000 (21:00 +0000)]
Turn off llvm/clang's ENABLE_BACKTRACES setting, since it never worked
properly anyway.  (Upstream has reorganized this somewhat in the mean
time, but for proper backtraces we would need llvm-symbolizer in base.)

MFC after: 3 days

7 years agoReorder the minimum_cmd_size code to make it a little smaller and
scottl [Thu, 20 Apr 2017 20:46:34 +0000 (20:46 +0000)]
Reorder the minimum_cmd_size code to make it a little smaller and
easier to read.

7 years agoMention GEOM_MOUNTVER.
trasz [Thu, 20 Apr 2017 20:06:51 +0000 (20:06 +0000)]
Mention GEOM_MOUNTVER.

MFC after: 2 weeks

7 years agoGNU diff is done and GNU diff3 is not using libgnuregex, so no need to
bapt [Thu, 20 Apr 2017 19:33:00 +0000 (19:33 +0000)]
GNU diff is done and GNU diff3 is not using libgnuregex, so no need to
condition the build of libgnuregex anymore on WITHOUT_GNU_DIFF

7 years agoOnly build libreadline for gdb, binutils actually does not need it
bapt [Thu, 20 Apr 2017 19:29:35 +0000 (19:29 +0000)]
Only build libreadline for gdb, binutils actually does not need it

7 years agoReplace again GNU diff with BSD diff
bapt [Thu, 20 Apr 2017 19:24:51 +0000 (19:24 +0000)]
Replace again GNU diff with BSD diff

After a firts failed attempt, BSD diff is now good enough to replace
GNU diff.

Relnotes: yes

7 years agoSyncoockies can be used in combination with the syncache. If the cache
tuexen [Thu, 20 Apr 2017 19:19:33 +0000 (19:19 +0000)]
Syncoockies can be used in combination with the syncache. If the cache
overflows, syncookies are used.
This patch restricts the usage of syncookies in this case: accept
syncookies only if there was an overflow of the syncache recently.
This mitigates a problem reported in PR217637, where is syncookie was
accepted without any recent drops.
Thanks to glebius@ for suggesting an improvement.

PR: 217637
Reviewed by: gnn, glebius
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D10272

7 years agoCross reference pr(1) which diff might call with -l option
bapt [Thu, 20 Apr 2017 19:14:52 +0000 (19:14 +0000)]
Cross reference pr(1) which diff might call with -l option

7 years agoUpdate the TODO list to reflect what has been changed
bapt [Thu, 20 Apr 2017 19:07:52 +0000 (19:07 +0000)]
Update the TODO list to reflect what has been changed

7 years agoDocument all long options
bapt [Thu, 20 Apr 2017 19:05:43 +0000 (19:05 +0000)]
Document all long options

7 years agoReadd Big5: some large databases setup are still requiring it.
bapt [Thu, 20 Apr 2017 18:21:50 +0000 (18:21 +0000)]
Readd Big5: some large databases setup are still requiring it.

Reported by: "張君天(Chun-Tien Chang)" <tcs@kitty.2y.idv.tw>

7 years agolibpthread_db: undo the memset size change.
pfg [Thu, 20 Apr 2017 17:58:27 +0000 (17:58 +0000)]
libpthread_db: undo the memset size change.

I inadvertedly soubled the size of the memset without noticing the
start address had changed. The size for the memset in pt_map_thread()
shouldn't actually match the reallocarray() so undo that part of r317200.

This is a re-commit of r317201 to clarify the log.

X-MFC with: r317200

7 years agoRevert r317201 to fix the log.
pfg [Thu, 20 Apr 2017 17:54:59 +0000 (17:54 +0000)]
Revert r317201 to fix the log.

7 years agolibpthread_db: leave the memset size from unchanged.
pfg [Thu, 20 Apr 2017 17:49:37 +0000 (17:49 +0000)]
libpthread_db: leave the memset size from unchanged.

The size for the memset in pt_map_thread() shouldn't actually match the
reallocarray() so undo that part of r317200.

X-MFC with: r317200

7 years agolibthread_db: unsign map_len and use reallocarray(3).
pfg [Thu, 20 Apr 2017 17:43:25 +0000 (17:43 +0000)]
libthread_db: unsign map_len and use reallocarray(3).

Lengths are not negative, so map_len should be unsigned. Unsign the
corresponding indexes too and bring a small use of reallocarray(3).

Reorder the memset to be consistent with the realloc: it appears we
were only clearing half the memory in pt_map_thread().

MFC after: 2 weeks

7 years agoEliminate the ega renderer switch. It did nothing useful except hold
bde [Thu, 20 Apr 2017 17:22:03 +0000 (17:22 +0000)]
Eliminate the ega renderer switch.  It did nothing useful except hold
a pointer to the main ega drawing method which is misoptimized be in
a different function than the main vga planar mode drawing method.
Vga initialization handles everything with no extra code except for
selecting the different function.

7 years agoWhen the character width is 9, remove vertical lines in the mouse cursor
bde [Thu, 20 Apr 2017 16:34:09 +0000 (16:34 +0000)]
When the character width is 9, remove vertical lines in the mouse cursor
corresponding to the gaps between characters.  This fixes distortion
of the cursor due to expanding it across the gaps.

Again for character width 9, when the cursor characters are not in the
graphics range (0xb0-0xdf), the gaps were always there (filled in the
background color for the previous char).  They still look strange, but
don't cause distortion.  When the cursor characters are in the graphics
range, the gaps are filled by repeating the previous line.  This gives
distortion with cilia.  Removing vertical lines reduces the distortion
to vertical cilia.

Move the default for the cursor characters out of the graphics range.
With character width 9, this gives gaps instead of distortion and
other problems.  With character width 8, it just fixes a smaller set
of other problems.  Some distortion and other problems can be recovered
using vidcontrol -M.  Presumably the default was to fill the gaps
intentionally, but it is much better to leave gaps.  The gaps can even
be considered as a feature for text processing -- they give sub-pointers
to character boundaries.  The other problems are: (1) with character
width 9, characters near the cursor are moved into the graphics range
and thus distorted if any of their 8th bits is set; (2) conflicts with
national characters in the graphics range.

The default range for the graphics cursor characters is now 8-11.  This
doesn't conflict with anything, since the glyphs for the characters in
this range are unreachable.

Use the 10x16 mouse cursor in text mode too (if the font size is >= 14).

When the character width is 9, removal of 1 or 2 vertical lines makes
10x16 cursor no wider than the 9x13 one usually was.  We could even
handle cursors 1 pixel wider in 2 character cells and gaps without
more clipping than given by the gaps (the worst case is 1 pixel in the
left cell, 1 removed in the middle gap, 8 in the right cell and 1
removed in the right gap.  The pixel in the right gap is removed so
it doesn't matter if it is in the font).

When the character width is 8, we now clip the 10-wide cursor by 1
pixel in the worst case.  This clipping is usually invisible since it
is of the border and and the border usually merges with the background
so is invisible.  There should be an option to use reverse video to
highlight the border and its tip instead of the interior (graphics
mode can do better using separate colors).  This needs the 9x13 cursor
again.

Ideas from: ache (especially about the bad default character range)

7 years agoRestrict the arm64 supervisor all instructions to only allow a zero
andrew [Thu, 20 Apr 2017 15:53:20 +0000 (15:53 +0000)]
Restrict the arm64 supervisor all instructions to only allow a zero
immediate value for system calls. We may wish to use other values in the
future for other purposes.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoWrite-combine framebuffer writes through user-space mappings, if possible.
kib [Thu, 20 Apr 2017 15:18:15 +0000 (15:18 +0000)]
Write-combine framebuffer writes through user-space mappings, if possible.

Note that KVA mapping of the framebuffer already uses write-combining
mode, so the change, besides improving speed of user mode writes, also
satisfies requirement of the IA32 architecture of using consistent
caching modes for multiple mappings of the same page.

Reported and tested by: bde
Sponsored by: The FreeBSD Foundation
MFC after:  1 week

7 years agoUpdate comment ot reflect realilty, we know also take care of CPUs that
cognet [Thu, 20 Apr 2017 15:06:16 +0000 (15:06 +0000)]
Update comment ot reflect realilty, we know also take care of CPUs that
provide a enable-method.

Suggested by: jhibbits

7 years agoImplement a basic --changed-group-format
bapt [Thu, 20 Apr 2017 14:22:33 +0000 (14:22 +0000)]
Implement a basic --changed-group-format

etcupdate(8) requires that option, while GNU diff supports many more variation
of that options, their behaviour beside the simple verion implemented here are
quite inconsistent as such I do not plan to implement those.

The only special keyword supported by this implementation are: %< and %>
%= is not implemented as the documentation of GNU diff says: common lines, but
it actually when tested print the changes from the first file

7 years agoelfcopy: document --strip-symbols=filename in the man page
emaste [Thu, 20 Apr 2017 13:57:53 +0000 (13:57 +0000)]
elfcopy: document --strip-symbols=filename in the man page

Reported by: bz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoPush loading curthread into assembly in the synchronous exception handlers.
andrew [Thu, 20 Apr 2017 13:56:30 +0000 (13:56 +0000)]
Push loading curthread into assembly in the synchronous exception handlers.
This will help investigating the performance impact of moving parts of the
switch statement in do_el0_sync into assembly.

Sponsored by: DARPA, AFRL

7 years agoePAPR states that any non-boot CPU will come in "disabled" state. So we should
cognet [Thu, 20 Apr 2017 13:56:06 +0000 (13:56 +0000)]
ePAPR states that any non-boot CPU will come in "disabled" state. So we should
not consider a "disabled" cpu as a CPU we have to ignore, and we should use
them if they provide a "enable-method".
While I'm there, support "ok" as well as "okay", while ePAPR only accepts
"okay", linux accepts "ok" too so we can expect it to be used.

Reviewed by: andrew (partially)

7 years agoAttempt to determine the modes in which 8-bit wide characters are actually
bde [Thu, 20 Apr 2017 13:46:55 +0000 (13:46 +0000)]
Attempt to determine the modes in which 8-bit wide characters are actually
9 wide.

I only need this to improve the mouse cursor, but it has always been
needed to select and/or adjust fonts.

This is complicated because there are no standard parameter tables
giving this bit of information directly, and the device register bit
giving the information can't be trusted even if it is read from the
hardware.  Use a heuristic to guess if the device register can be
trusted.  (The device register is normally read from the BIOS mode
table, but on my system where the device register is wrong, the mode
table doesn't match the hardware and is not used; the device registers
are used in this case.)

7 years agoAdd a regression test for diff -D
bapt [Thu, 20 Apr 2017 11:32:18 +0000 (11:32 +0000)]
Add a regression test for diff -D

7 years agopf: Fix possible incorrect IPv6 fragmentation
kp [Thu, 20 Apr 2017 09:05:53 +0000 (09:05 +0000)]
pf: Fix possible incorrect IPv6 fragmentation

When forwarding pf tracks the size of the largest fragment in a fragmented
packet, and refragments based on this size.
It failed to ensure that this size was a multiple of 8 (as is required for all
but the last fragment), so it could end up generating incorrect fragments.

For example, if we received an 8 byte and 12 byte fragment pf would emit a first
fragment with 12 bytes of payload and the final fragment would claim to be at
offset 8 (not 12).

We now assert that the fragment size is a multiple of 8 in ip6_fragment(), so
other users won't make the same mistake.

Reported by: Antonios Atlasis <aatlasis at secfu net>
MFC after: 3 days

7 years agoSome cosmetic polishing for pre-timeouts.
mav [Thu, 20 Apr 2017 09:01:31 +0000 (09:01 +0000)]
Some cosmetic polishing for pre-timeouts.

MFC after: 1 week

7 years agoRegenerate src.conf(5) after recent additions/clarifications
ngie [Thu, 20 Apr 2017 03:43:37 +0000 (03:43 +0000)]
Regenerate src.conf(5) after recent additions/clarifications

Sponsored by: Dell EMC Isilon

7 years agoCleanup QLA_LOCK/QLA_UNLOCK macros
davidcs [Thu, 20 Apr 2017 03:41:42 +0000 (03:41 +0000)]
Cleanup QLA_LOCK/QLA_UNLOCK macros
remove unused QLA_TX_LOCK/QLA_TX_UNLOCK macros
format qla_error_recovery()

MFC after:3 days

7 years agoClean up WITH*_PROFILE
ngie [Thu, 20 Apr 2017 03:36:09 +0000 (03:36 +0000)]
Clean up WITH*_PROFILE

- Clarify that profiled libraries are usable with gprof(8).
- Add WITH_PROFILE to complement WITHOUT_PROFILE and placate makeman.

MFC after: 7 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd WITH_GROFF to complement WITHOUT_GROFF and placate complaints from makeman
ngie [Thu, 20 Apr 2017 03:32:30 +0000 (03:32 +0000)]
Add WITH_GROFF to complement WITHOUT_GROFF and placate complaints from makeman

MFC after: 7 weeks
Sponsored by: Dell EMC Isilon

7 years agoFree lro_hash unconditionally, just like lro_mbuf_data a few lines
np [Wed, 19 Apr 2017 23:06:07 +0000 (23:06 +0000)]
Free lro_hash unconditionally, just like lro_mbuf_data a few lines
later.  Fix whitespace nit while here.

7 years agoBump __FreeBSD_version due to r317061, struct vmmeter changes.
glebius [Wed, 19 Apr 2017 22:50:19 +0000 (22:50 +0000)]
Bump __FreeBSD_version due to r317061, struct vmmeter changes.

7 years agoFix build without SC_PIXEL_MODE defined.
glebius [Wed, 19 Apr 2017 22:48:27 +0000 (22:48 +0000)]
Fix build without SC_PIXEL_MODE defined.

7 years agoRevert r316796. It is not necessary since r317173.
jkim [Wed, 19 Apr 2017 22:43:11 +0000 (22:43 +0000)]
Revert r316796.  It is not necessary since r317173.

7 years agoAlways clear borders when the terminal is flushed.
jkim [Wed, 19 Apr 2017 22:41:24 +0000 (22:41 +0000)]
Always clear borders when the terminal is flushed.

PR: 202288

7 years agoDo not leak lro_hash on failure to allocate lro_mbuf_data.
np [Wed, 19 Apr 2017 22:27:26 +0000 (22:27 +0000)]
Do not leak lro_hash on failure to allocate lro_mbuf_data.

MFC after: 1 week

7 years agoMicro-optimize vt_set_border().
jkim [Wed, 19 Apr 2017 22:21:15 +0000 (22:21 +0000)]
Micro-optimize vt_set_border().

7 years agoRemove redundant assignment.
np [Wed, 19 Apr 2017 22:20:41 +0000 (22:20 +0000)]
Remove redundant assignment.

7 years agoTrim trailing '/release/..' when setting _OBJDIR so arm64/aarch64
gjb [Wed, 19 Apr 2017 21:18:06 +0000 (21:18 +0000)]
Trim trailing '/release/..' when setting _OBJDIR so arm64/aarch64
boot1.efifat is properly located when creating virtual machine images.

Sponsored by: The FreeBSD Foundation

7 years agoAdd a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to build
ngie [Wed, 19 Apr 2017 20:45:46 +0000 (20:45 +0000)]
Add a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to build
rpcbind(8) with/without warmstart support.

The knob defaults to off to preserve POLA for the feature.

See rpcbind(8) for more details about the warmstart feature.

MFC after: 7 weeks
Relnotes: yes
Sponsored by: Dell EMC Isilon

7 years agoAdd WITH_CXX to complement WITHOUT_CXX and placate makeman's complaints
ngie [Wed, 19 Apr 2017 20:35:47 +0000 (20:35 +0000)]
Add WITH_CXX to complement WITHOUT_CXX and placate makeman's complaints

MFC after: 7 weeks
Sponsored by: Dell EMC Isilon

7 years agopom: Remove useless cap_rights_init
manu [Wed, 19 Apr 2017 20:35:04 +0000 (20:35 +0000)]
pom: Remove useless cap_rights_init

Pointy-Hat: manu

Reported by: bapt

7 years agoCapsicumize pom
manu [Wed, 19 Apr 2017 20:27:48 +0000 (20:27 +0000)]
Capsicumize pom

Since pom is the only binary that can save lives, capsicumize it to be
sure that it's safe to run it.

Reviewed by: bapt

7 years agoFix indentation per style.Makefile(5)
ngie [Wed, 19 Apr 2017 20:27:13 +0000 (20:27 +0000)]
Fix indentation per style.Makefile(5)

MFC after: 7 weeks
Sponsored by: Dell EMC Isilon

7 years agorpcbind(8): post-humously document -w (warmstart) support added in r74462
ngie [Wed, 19 Apr 2017 20:23:27 +0000 (20:23 +0000)]
rpcbind(8): post-humously document -w (warmstart) support added in r74462

warmstart support saves portmap/rpcbind(8) registration state on exit and
restores the saved registration state on restart.

MFC after: 7 weeks
Sponsored by: Dell EMC Isilon

7 years agorpcbind(8): add a description for /var/run/rpcbind.sock under the FILES section
ngie [Wed, 19 Apr 2017 20:04:45 +0000 (20:04 +0000)]
rpcbind(8): add a description for /var/run/rpcbind.sock under the FILES section

MFC after: 7 weeks
Sponsored by: Dell EMC Isilon

7 years agowhich(1): sort #includes
ngie [Wed, 19 Apr 2017 19:55:38 +0000 (19:55 +0000)]
which(1): sort #includes

No functional change [intended].

MFC after: 7 weeks
Sponsored by: Dell EMC Isilon

7 years agoClean up trailing whitespace
ngie [Wed, 19 Apr 2017 19:52:40 +0000 (19:52 +0000)]
Clean up trailing whitespace

No functional changes

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agolibstdc++: fix symbol version script for LLD
emaste [Wed, 19 Apr 2017 19:06:47 +0000 (19:06 +0000)]
libstdc++: fix symbol version script for LLD

LLD is less tolerant of inconsistencies in the symbol version script.

- Add a ; on the last entry in a version block
- Remove duplicated symbols, retaining those in the earliest block

Reviewed by: bdrewery
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10428

7 years agoRemove WITHOUT_GNU and WITHOUT_GNU_SUPPORT src.conf.knobs
emaste [Wed, 19 Apr 2017 18:59:38 +0000 (18:59 +0000)]
Remove WITHOUT_GNU and WITHOUT_GNU_SUPPORT src.conf.knobs

These have no effect (and WITHOUT_GNU is documented as having no
effect). I intend to later introduce a WITHOUT_GPL knob to serve a
similar purpose as WITHOUT_GNU's previously documented intent, but with
a more accurate name. To avoid confusion over the transition though just
remove the existing, nonfunctional ones.

7 years agoFix missing support for drawing the mouse cursor in depth 24 of direct
bde [Wed, 19 Apr 2017 18:35:34 +0000 (18:35 +0000)]
Fix missing support for drawing the mouse cursor in depth 24 of direct
mode.

Use the general DRAWPIXEL() macro with its bigger case statement
(twice) instead of our big case statement (once).  DRAWPIXEL() is more
complicated since it is not missing support for depth 24 or
complications for colors in depth 16 (we currently hard-code black and
white so the complications for colors are not needed).  DRAWPIXEL()
also does the bpp calculation in the inner loop.  Compilers optimize
DRAWPIXEL() well enough, and the main text drawing method always
depended on this.  In direct mode, mouse cursor drawing is now similar
to normal text drawing except it draws in 2 hard-coded colors instead
of 1 variable color.

This also fixes a nested hard-coding of colors.  DRAWPIXEL() uses the
palette in all cases, but the direct code didn't use the palette for
its hard-coded black.  This only had an effect in depth 8, since
changing the palette is not supported in other depths.

7 years agomakeman: add a comment describing purpose and invocation
emaste [Wed, 19 Apr 2017 18:11:08 +0000 (18:11 +0000)]
makeman: add a comment describing purpose and invocation

Reviewed by: jhb, ngie
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10389

7 years agorpcbind(8): wordsmith -h description and mention -W in the SYNOPSIS section
ngie [Wed, 19 Apr 2017 18:01:53 +0000 (18:01 +0000)]
rpcbind(8): wordsmith -h description and mention -W in the SYNOPSIS section

-W was already documented in the OPTIONS section.

MFC after: 7 weeks
Reported by: igor (-h wordsmith'ing)
Sponsored by: Dell EMC Isilon

7 years agoPrint out the signal number on exit in terminate(..) if WARMSTART is compiled
ngie [Wed, 19 Apr 2017 17:51:32 +0000 (17:51 +0000)]
Print out the signal number on exit in terminate(..) if WARMSTART is compiled
into rpcbind.

The signal number can provide helpful diagnostic info.

MFC after: 1 week
Obtained from: Isilon OneFS
Sponsored by: Dell EMC Isilon

7 years agoFollow r317061 "Remove struct vmmeter from struct pcpu"
br [Wed, 19 Apr 2017 17:06:32 +0000 (17:06 +0000)]
Follow r317061 "Remove struct vmmeter from struct pcpu"
with MD changes for RISC-V.

This unbreaks RISC-V build.

Sponsored by: DARPA, AFRL

7 years agoStop using a saveunder method for mouse cursor drawing in the vga
bde [Wed, 19 Apr 2017 16:24:51 +0000 (16:24 +0000)]
Stop using a saveunder method for mouse cursor drawing in the vga
direct mode renderer.  I thought that reads were not much slower than
writes, so that the method only tripled the time for the whole function,
but I recently measured that video memory reads can be up to 53 times
slower than writes in tighter loops than here.  Loop overheap here
reduces the multiplier to only 16-20 on Haswell.

Start cleaning up and fixing larger bugs in this function.  Only replace
the 22-line removal loop by a 3-line one for now, since adjusting the
old loop would have required many palette calculations which are better
done in the DRAW_PIXEL() macro.  This also fixes missing support for
depth 24, but only for removal.

Removal is currently sloppy at the right bottom corner.  It sometimes
leaks border color into the text window.  This is soon cleaned up by the
caller.  The planar renderer has complications to clip at the corner.

7 years agoDrop Giant before sleeping in linux_wait_for_{timeout_,}common().
markj [Wed, 19 Apr 2017 16:12:02 +0000 (16:12 +0000)]
Drop Giant before sleeping in linux_wait_for_{timeout_,}common().

Reported and tested by: Pete Wright <pete@nomadlogic.org>
Reviewed by: hselasky (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10414

7 years agoDon't use __builtin_bswap for RISC-V due to undefined reference
br [Wed, 19 Apr 2017 15:24:33 +0000 (15:24 +0000)]
Don't use __builtin_bswap for RISC-V due to undefined reference
in compiler.

This unbreaks RISC-V world build.

Sponsored by: DARPA, AFRL

7 years agoAdd infrastructure to the ATA and SCSI transports that supports
scottl [Wed, 19 Apr 2017 15:04:52 +0000 (15:04 +0000)]
Add infrastructure to the ATA and SCSI transports that supports
using a driver-supplied sbuf for printing device discovery
announcements. This helps ensure that messages to the console
will be properly serialized (through sbuf_putbuf) and not be
truncated and interleaved with other messages. The
infrastructure mirrors the existing xpt_announce_periph()
entry point and is opt-in for now. No content or formatting
changes are visible to the operator other than the new coherency.

While here, eliminate the stack usage of the temporary
announcement buffer in some of the drivers. It's moved to the
softc for now, but future work will eliminate it entirely by
making the code flow more linear. Future work will also address
locking so that the sbufs can be dynamically sized.

The scsi_da, scs_cd, scsi_ses, and ata_da drivers are converted
at this point, other drivers can be converted at a later date.
A tunable+sysctl, kern.cam.announce_nosbuf, exists for testing
purposes but will be removed later.

TODO:
Eliminate all of the code duplication and temporary buffers.  The
old printf-based methods will be retired, and xpt_announce_periph()
will just be a wrapper that uses a dynamically sized sbuf.  This
requires that the register and deregister paths be made malloc-safe,
which they aren't currently.

Sponsored by: Netflix

7 years agoWhen we don't use the parameter table in the BIOS, also don't use most
bde [Wed, 19 Apr 2017 14:49:18 +0000 (14:49 +0000)]
When we don't use the parameter table in the BIOS, also don't use most
of our tweaked modes based on it.  In practice, this means limiting the
tweaked modes to at most 80x50 based on 80x25, so there are no 90-column,
80x30 or 80x60 modes.

This happens when the the initial mode is is not in the parameter
table.  We always detected this case, but assumed that the (necessarily
nonstandard) parameters of the initial mode could be tweaked just as
blindly as the probably-standard parameters of initial modes in the
table.

On 1 laptop system with near-VGA where the initial mode is nonstandard,
this is because the hardware apparently doesn't support 9-bit mode,
but otherwise has standard timing.  The initial mode has 8-bit mode
CRTC horizontal parameters similar to those in syscons' 90-column modes
and in EGA modes.  Tweaking these values for the 90-column modes has
little effect except to print the extra 10 columns off the screen.
Tweaking from 80x25 to 80x30 requires changing from 400 scan lines to
480.  This can probably be made to work, but syscons blindly applies
values based on standard timing.  This gives blank output.  Tweaking
from 80x25 to 80x50 doesn't change the CRTC timing and works.

7 years agoreadelf: dump MIPS abiflags section
emaste [Wed, 19 Apr 2017 14:43:51 +0000 (14:43 +0000)]
readelf: dump MIPS abiflags section

This is not fully fleshed out but is sufficient to dump the
SHT_MIPS_ABIFLAGS used in FreeBSD.

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

7 years agoRestore prototype accidently removed by r316811. Also remove $NetBSD$
cy [Wed, 19 Apr 2017 13:24:32 +0000 (13:24 +0000)]
Restore prototype accidently removed by r316811.  Also remove $NetBSD$
accidentally added.

Reported by: hps, lwhsu

7 years agoUse __typeof() instead of typeof() in some RCU related macros in the LinuxKPI.
hselasky [Wed, 19 Apr 2017 13:04:34 +0000 (13:04 +0000)]
Use __typeof() instead of typeof() in some RCU related macros in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix problem regarding priority inversion when using the concurrency
hselasky [Wed, 19 Apr 2017 13:03:29 +0000 (13:03 +0000)]
Fix problem regarding priority inversion when using the concurrency
kit, CK, in the LinuxKPI.

When threads are pinned to a CPU core or when there is only one CPU,
it can happen that a higher priority thread can call the CK
synchronize function while a lower priority thread holds the read
lock. Because the CK's synchronize is a simple wait loop this can lead
to a deadlock situation. To solve this problem use the recently
introduced CK's wait callback function.

When detecting a CK blocking condition figure out the lowest priority
among the blockers and update the calling thread's priority and
yield. If another CPU core is holding the read lock, pin the thread to
the blocked CPU core and update the priority. The calling threads
priority and CPU bindings are restored before return.

If a thread holding a CK read lock is detected to be sleeping, pause()
will be used instead of yield().

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoA test was moved but without the definition of $d.
n_hibma [Wed, 19 Apr 2017 12:39:45 +0000 (12:39 +0000)]
A test was moved but without the definition of $d.

The test however always succeeds because 'test -d' always returns true.

Also some speling fixes.

7 years agoZero number of CPUs should be translated into the default number of
hselasky [Wed, 19 Apr 2017 11:38:07 +0000 (11:38 +0000)]
Zero number of CPUs should be translated into the default number of
CPUs when allocating a LinuxKPI workqueue. This also ensures that the
created taskqueue always have a non-zero number of worker threads.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUse hwreset_get_by_ofw_idx() function instead, since there is
ganbold [Wed, 19 Apr 2017 05:59:00 +0000 (05:59 +0000)]
Use hwreset_get_by_ofw_idx() function instead, since there is
no reset-names dts property defined for IR in case of H3 SoC.
That way IR works on H3 SoC based board.
Tested on Orangepi mini 2 board.

7 years agohyperv: Use kmem_malloc for hypercall memory due to NX bit change.
sephe [Wed, 19 Apr 2017 02:39:48 +0000 (02:39 +0000)]
hyperv: Use kmem_malloc for hypercall memory due to NX bit change.

Reported by: dexuan@
MFC after: now
Sponsored by: Microsoft

7 years agoIf MAKEOBJDIRPREFIX is a prefix match for .CURDIR, then __objdir is .CURDIR
sjg [Tue, 18 Apr 2017 23:59:15 +0000 (23:59 +0000)]
If MAKEOBJDIRPREFIX is a prefix match for .CURDIR, then __objdir is .CURDIR

Reviewed by: bdrewery

7 years agoUpdate objects in liblldb for the MK_LLDB=yes case.
dim [Tue, 18 Apr 2017 21:21:31 +0000 (21:21 +0000)]
Update objects in liblldb for the MK_LLDB=yes case.

7 years agoda(4): Fix a TRIM regression introduced in r308155
cem [Tue, 18 Apr 2017 21:05:05 +0000 (21:05 +0000)]
da(4): Fix a TRIM regression introduced in r308155

According to Warner, multiple TRIM BIOs are collapsed into a single CCB with
NULL bp.  It is invalid to biotrack() NULL, and results in a fault.  So,
don't do that.

Reported by: asomers@
Sponsored by: Dell EMC Isilon

7 years agoFor lldb, delete the custom Xcode-only Host/Config.h, and provide a
dim [Tue, 18 Apr 2017 20:31:02 +0000 (20:31 +0000)]
For lldb, delete the custom Xcode-only Host/Config.h, and provide a
pre-generated version in lib/clang/include/lldb/Host instead, similar to
what we do for clang, llvm and lld.

7 years agopf: Also clear limit counters
kp [Tue, 18 Apr 2017 20:07:21 +0000 (20:07 +0000)]
pf: Also clear limit counters

The "pfctl -F info" command didn't clear the limit counters ( as shown in the
"pfctl -vsi" output).

Submitted by: Max <maximos@als.nnov.ru>

7 years agoRegenerate to note that GDB is now off by default on most platforms.
jhb [Tue, 18 Apr 2017 19:54:04 +0000 (19:54 +0000)]
Regenerate to note that GDB is now off by default on most platforms.

Note that this commit also adds the default riscv settings for all
options since riscv was added to 'make targets' since the last time
this was generated.

Reminded by: emaste

7 years agoUse relative symlink for 'latest' to allow repo to work after being
gjb [Tue, 18 Apr 2017 19:44:34 +0000 (19:44 +0000)]
Use relative symlink for 'latest' to allow repo to work after being
moved.

Submitted by: woodsb02
MFC after: 3 days
PR: 217197
Sponsored by: The FreeBSD Foundation

7 years agoloader: uboot disk ioctl should call disk_ioctl
tsoome [Tue, 18 Apr 2017 19:36:58 +0000 (19:36 +0000)]
loader: uboot disk ioctl should call disk_ioctl

As the uboot disk interface is using common/disk.c API, we also
should use disk_ioctl() call, this will give us chance to read partition
sizes and have feature parity with UEFI and BIOS implementations.

This does also fix arm boot issue on some systems, reported/tested by Ian,
thanks.

Reported by: ian
Reviewed by: ian
Differential Revision: https://reviews.freebsd.org/D10421

7 years agoAdd new objects to usr.bin/clang/lld for the MK_LLD=yes case.
dim [Tue, 18 Apr 2017 19:15:06 +0000 (19:15 +0000)]
Add new objects to usr.bin/clang/lld for the MK_LLD=yes case.

7 years agoloader: F_READ/F_WRITE should be checked against masked flag
tsoome [Tue, 18 Apr 2017 18:07:54 +0000 (18:07 +0000)]
loader: F_READ/F_WRITE should be checked against masked flag

The work to make it possible to avoid bcache via using F_NORA modifier did
miss the fact that not all loader platforms are using the bcache, and so
it is possible the modifier is not cleared, as bcache strategy function is
not used.

For fix, we make sure the checks are dont with masked flag.

This patch does fix boot for platforms which do not use bcache.

Reported by: emaste
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D10422

7 years agoAdd new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
dim [Tue, 18 Apr 2017 17:39:20 +0000 (17:39 +0000)]
Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.

7 years agoSwitch BERI Programmable Interrupt Controller to INTRNG.
br [Tue, 18 Apr 2017 17:20:03 +0000 (17:20 +0000)]
Switch BERI Programmable Interrupt Controller to INTRNG.

Sponsored by: DARPA, AFRL

7 years agoDisable in-tree GDB by default on x86, mips, and powerpc.
jhb [Tue, 18 Apr 2017 16:27:48 +0000 (16:27 +0000)]
Disable in-tree GDB by default on x86, mips, and powerpc.

GDB in ports contains all of the functionality as GDB in base
(including kgdb) for these platforms along with additional
functionality.  In-tree GDB remains enabled on ARM and sparc64.
GDB in ports does not currently support kernel debugging on arm,
and ports GDB for sparc64 has not been tested (though it does
include sparc64 support).

Reviewed by: bdrewery, emaste, imp
Relnotes: yes
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D10399

7 years agoloader: zfs reader vdev_probe should check for minimum device size
tsoome [Tue, 18 Apr 2017 15:43:47 +0000 (15:43 +0000)]
loader: zfs reader vdev_probe should check for minimum device size

The smallest device we can have in the pool is 64MB, since we are trying to
walk all four labels to find the most up to date uberblock, this limit will
also give us good method to check if we even should attempt to probe.

Enforcing the check also will make sure we are not getting wrapped while
calculating the label offset.

Also, after label check, we should verify if we actually got any UB or not.

PR: 218473
Reported by: Masachika ISHIZUKA
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D10381

7 years agoDocument kevent EVFILT_EMPTY.
pluknet [Tue, 18 Apr 2017 15:36:13 +0000 (15:36 +0000)]
Document kevent EVFILT_EMPTY.

Reviewed by: hiren
X-MFC with: r312277

7 years agoOptimize Armada38x low-level MBUS settings
zbb [Tue, 18 Apr 2017 10:39:14 +0000 (10:39 +0000)]
Optimize Armada38x low-level MBUS settings

Add early init handler, which comprises various internal
bus optimisations for Armada 38x SoC's. Magic values used
due to undocumented registers.

Submitted by: Marcin Wojtas <mw@semihalf.com>,
Arnaud Ysmal <arnaud.ysmal@stormshield.eu>
Obtained from: Semihalf, Stormshield
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10219

7 years agoFix bit assignment in PL310_POWER_CTRL
zbb [Tue, 18 Apr 2017 10:37:08 +0000 (10:37 +0000)]
Fix bit assignment in PL310_POWER_CTRL

Align to ARM specification:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0246f/BEIEHICF.html

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: meloun-miracle-cz
Differential revision: https://reviews.freebsd.org/D10223

7 years agoAdd PL310 device in ARMADA38X config
zbb [Tue, 18 Apr 2017 10:35:30 +0000 (10:35 +0000)]
Add PL310 device in ARMADA38X config

Submitted by: Arnaud Ysmal <arnaud.ysmal@stormshield.eu>
Obtained from: Stormshield
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10222

7 years agoExecute PL310_ERRATA_727915 only for related revisions
zbb [Tue, 18 Apr 2017 10:34:10 +0000 (10:34 +0000)]
Execute PL310_ERRATA_727915 only for related revisions

Part of PL310 erratum 727915 in pl310_wbinv_range() was
executed uncoditionally for all possible controllers'
revisions. This patch adds appropriate condition, since
extra operations are required only for revisions between
r2p0 and r3p0.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: meloun-miracle-cz
Differential revision: https://reviews.freebsd.org/D10221

7 years agoAdd PL310 platform initialization for Armada 38x
zbb [Tue, 18 Apr 2017 10:32:21 +0000 (10:32 +0000)]
Add PL310 platform initialization for Armada 38x

Introduce machine-dependent part of the arm/pl310 driver for
Armada 38x SoCs. Add prefetch and power savings configuration.

Submitted by: <arnaud.ysmal@stormshield.eu>
Obtained from: Stormshield
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10220

7 years agoIncrease number of L2 tables required for kernel bootstrap
zbb [Tue, 18 Apr 2017 10:25:59 +0000 (10:25 +0000)]
Increase number of L2 tables required for kernel bootstrap

Memory space reserved for pmap_kernel_l2dtable_kva and
pmap_kernel_l2ptp_kva has not been taken into account in
original code. All the memory reserved from kernel space by
pmap_alloc_specials() function called in pmap_bootstrap()
should be mapped initially by initarm(). To create initial
mapping initarm() function reserves proper number of l2 page
tables. However the number of the l2 page tables does not take
into account memory for: pmap_kernel_l2ptp_kva,
pmap_kernel_l2dtable_kva, crashdumpmap, etc.

Submitted by: Grzegorz Bernacki <gjb@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: meloun-miracle-cz
Differential revision: https://reviews.freebsd.org/D10217

7 years agoReduce kmem_arena maximum size for Armada38x
zbb [Tue, 18 Apr 2017 10:20:42 +0000 (10:20 +0000)]
Reduce kmem_arena maximum size for Armada38x

VM_KMEM_SIZE_MAX allows to limit kmem arena size. In our case this was
necessary, as decreasing size of kmem_arena leaves more space for
kernel_arena.

kernel_arena is pool used for contigmalloc (in effect, DMA) allocations,
which failed on Armada38x. This resulted in 'no memory errors'
(e.g. USB_ERR_NOMEM errors) and failure of whole system. The need for
greater size of kernel_arena probably comes from more peripherals making
use of busdma.

Value used as upper limit is half of the default value
(0x1399a000).

Submitted by: Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10216

7 years agoBlock FPDMA TRIM for ASMedia HBAs.
mav [Tue, 18 Apr 2017 08:04:15 +0000 (08:04 +0000)]
Block FPDMA TRIM for ASMedia HBAs.

Experiments show FPDMA TRIM command timeouts on ASMedia HBAs, while the
same SSDs working fine on Intel HBAs.

MFC after: 2 weeks

7 years agoPull in r300429 from upstream llvm trunk (by Benjamin Kramer):
dim [Tue, 18 Apr 2017 07:02:12 +0000 (07:02 +0000)]
Pull in r300429 from upstream llvm trunk (by Benjamin Kramer):

  [X86] Remove special handling for 16 bit for A asm constraints.

  Our 16 bit support is assembler-only + the terrible hack that is
  .code16gcc. Simply using 32 bit registers does the right thing for
  the latter.

  Fixes PR32681.

This fixes some cases of assembling 16 bit code (i.e. SeaBIOS) that uses
the 'A' inline asm constraint, after r316989.

MFC after: 3 days
X-MFC-With: r316989

7 years agoRemove function declaration that doesn't exist.
ganbold [Tue, 18 Apr 2017 06:58:04 +0000 (06:58 +0000)]
Remove function declaration that doesn't exist.

7 years agoAdd 32-bit caching to ldconfig script for powerpc64
jhibbits [Tue, 18 Apr 2017 03:40:36 +0000 (03:40 +0000)]
Add 32-bit caching to ldconfig script for powerpc64

Reported by: ian@