]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoo Add driver for PLIC (Platform-Level Interrupt Controller) device.
br [Tue, 12 Jun 2018 17:45:15 +0000 (17:45 +0000)]
o Add driver for PLIC (Platform-Level Interrupt Controller) device.
o Convert interrupt machdep support to use INTRNG code.

Sponsored by: DARPA, AFRL

6 years agoAdd simplebus-like RISC-V SoC bus.
br [Tue, 12 Jun 2018 17:07:30 +0000 (17:07 +0000)]
Add simplebus-like RISC-V SoC bus.

This is required in order to probe and attach devices described under
"riscv-virtio-soc" node of DTS.

Sponsored by: DARPA, AFRL

6 years agoRelease secondary cores from WFI (wait for interrupt) by sending them
br [Tue, 12 Jun 2018 16:47:33 +0000 (16:47 +0000)]
Release secondary cores from WFI (wait for interrupt) by sending them
an IPI.

This does not work however yet in QEMU. As a temporary workaround set
software interrupt pending bit manually on a local core to ensure WFI
doesn't halt the hart.

This is required to smpboot in QEMU.

Sponsored by: DARPA, AFRL

6 years agoEnable USB OTG serial terminal on ARM SD card images. This configures
trasz [Tue, 12 Jun 2018 16:45:52 +0000 (16:45 +0000)]
Enable USB OTG serial terminal on ARM SD card images.  This configures
the system to make use of USB device mode / USB OTG to provide a "virtual
serial port" on release images.

Reviewed by: gjb@
MFC after: 2 weeks
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15602

6 years agoAdd an example to the chflags(1) man page.
trasz [Tue, 12 Jun 2018 16:44:13 +0000 (16:44 +0000)]
Add an example to the chflags(1) man page.

MFC after: 2 weeks

6 years agoFix memory leak
bapt [Tue, 12 Jun 2018 16:42:11 +0000 (16:42 +0000)]
Fix memory leak

CID: 1393352

6 years agoCorrectly test return value of pipe(2)
bapt [Tue, 12 Jun 2018 16:40:22 +0000 (16:40 +0000)]
Correctly test return value of pipe(2)

CID: 1393351

6 years agoAlign virtual addressing entries.
br [Tue, 12 Jun 2018 16:19:27 +0000 (16:19 +0000)]
Align virtual addressing entries.

This is required due to C-compressed ISA extension option being turned on.

This fixes SMP operation in QEMU.

Sponsored by: DARPA, AFRL

6 years agoRework PSCI so it only searches for the call function once.
andrew [Tue, 12 Jun 2018 14:54:17 +0000 (14:54 +0000)]
Rework PSCI so it only searches for the call function once.

This is in preperation for supporting newer smccc functions that also use
the same call method.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D15745

6 years agolinux64: use linux output target for linux_vdso.so
emaste [Tue, 12 Jun 2018 13:32:42 +0000 (13:32 +0000)]
linux64: use linux output target for linux_vdso.so

linux_vdso.so provides the vdso for the linuxulator's amd64 target and
is mapped into a Linux binary's address space.  Thus it should be a
Linux-style .so, which has the ELF OS/ABI unset.

It turns out that ELF Tool Chain elfcopy/objcopy also has a bug where
the OS/ABI field is unset, regardless of the specified --output-target,
so this change is a no-op with the default in-tree toolchain.  This is a
real fix when using external binutils, and the ELF Tool Chain bug will
be fixed in the future.

PR: 228934
Sponsored by: Turing Robotic Industries

6 years agoAdd a driver for the BCM2835 Mini-UART as seen on the RPi3
db [Tue, 12 Jun 2018 13:26:31 +0000 (13:26 +0000)]
Add a driver for the BCM2835 Mini-UART as seen on the RPi3

Reviewed by: andrew
Approved by: andrew
Differential Revision: https://reviews.freebsd.org/D15684

6 years agoarm64: rockchip: Correctly set armclk
manu [Tue, 12 Jun 2018 11:47:21 +0000 (11:47 +0000)]
arm64: rockchip: Correctly set armclk

Parent needs to be the same frequency as the armclk, not twice the freq.
The real divider is incremented by one so write it with - 1
The rate can be at index 0

Pointy Hat To: myself

6 years agoAll exceptions IDT descriptors must use interrupt gates on 4/4 kernel.
kib [Tue, 12 Jun 2018 10:43:20 +0000 (10:43 +0000)]
All exceptions IDT descriptors must use interrupt gates on 4/4 kernel.
Fix it for #MF.

Noted by: rlibby
Sponsored by: The FreeBSD Foundation

6 years agoFix typo.
kib [Tue, 12 Jun 2018 10:41:26 +0000 (10:41 +0000)]
Fix typo.

Sponsored by: The FreeBSD Foundation

6 years agoImplement the ip_eth_mc_map() function in the LinuxKPI.
hselasky [Tue, 12 Jun 2018 08:43:49 +0000 (08:43 +0000)]
Implement the ip_eth_mc_map() function in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd hrs, meta and myself to share/misc/committers-ports.dot
pi [Tue, 12 Jun 2018 07:51:03 +0000 (07:51 +0000)]
Add hrs, meta and myself to share/misc/committers-ports.dot

Approved by: remko

6 years agotop(1): remove trailing whitespace
eadler [Tue, 12 Jun 2018 07:31:59 +0000 (07:31 +0000)]
top(1): remove trailing whitespace

6 years agotop(1): style and related
eadler [Tue, 12 Jun 2018 07:14:12 +0000 (07:14 +0000)]
top(1): style and related

- style(9)
- remove now-defunct comments
- remove getuid check for low delay
- expand range of format_k

6 years agotop(1): move command mapping to commands.c
eadler [Tue, 12 Jun 2018 06:53:31 +0000 (06:53 +0000)]
top(1): move command mapping to commands.c

This eliminates the difficult to follow mapping of a string list. It
moves numbers from "#define" into (more) debuggable enums. More
generally, it follows the trend of moving more data into a more central
mechanism.

The help output is a little worse: " " is not rendered well, and there
are duplicate entries, but that will be fixed in a followup.

6 years agocxgbe(4): Remove homemade version of htobe32 from the driver.
np [Tue, 12 Jun 2018 06:46:03 +0000 (06:46 +0000)]
cxgbe(4): Remove homemade version of htobe32 from the driver.

It was needed only for ia64 where it was implemented as a call to
bswapXX, which was always a real function.  htobeXX with a constant
argument is calculated at compile-time everywhere else.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agolualoader: More black-on-white fixes
kevans [Tue, 12 Jun 2018 03:44:34 +0000 (03:44 +0000)]
lualoader: More black-on-white fixes

To recap the problem: with a black-on-white xterm, the menu draws terribly.
Ideally, we would try our best for a white-on-black context for the menu
since graphics and whatnot might not be tested for other setups and there's
no reasonable way to sample the terminal at this point for the used color
scheme.

This commit attempts to address that further in two ways:
- Instead of issuing CSI bg/fg resets (CSI 39m and CSI 49m respectively for
  "default"), issue CSI bg/fg escape sequences for our expected color scheme
- Reset to *our* default color scheme before we even attempt to load the
  local module, so that we personally don't have any earlier text with the
  console default color scheme.

Reported by: emaste (again)

6 years agoFollow r333233, add fat32lba description to gpart(8)
lwhsu [Tue, 12 Jun 2018 01:50:58 +0000 (01:50 +0000)]
Follow r333233, add fat32lba description to gpart(8)

Reviewed by: emaste
MFC after: 3 days
X-MFC with: r333233
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15767

6 years agoFix a memory leak for the BIOCSETWF ioctl on kernels with the BPF_JITTER
jtl [Mon, 11 Jun 2018 23:32:06 +0000 (23:32 +0000)]
Fix a memory leak for the BIOCSETWF ioctl on kernels with the BPF_JITTER
option.

The BPF code was creating a compiled filter in the common filter-creation
path.  However, BPF only uses compiled filters in the read direction.
When creating a write filter, the common filter-creation code was
creating an unneeded write filter and leaking the memory used for that.

MFC after: 2 weeks
Sponsored by: Netflix

6 years agoUser service foo rather than /etc/rc.d/foo.
imp [Mon, 11 Jun 2018 22:48:34 +0000 (22:48 +0000)]
User service foo rather than /etc/rc.d/foo.

devd predates service in the system. Modernize usage to use service to
start/stop things in reaction to events rather than calling the rc
file directly.

This was pointed out in my talk at BSDcan as well as indirectly
referrred to as a barrier to entry for OpenRC in that working group.

6 years agomuge.4: remove BUGS section (about link/act LEDs)
emaste [Mon, 11 Jun 2018 20:46:20 +0000 (20:46 +0000)]
muge.4: remove BUGS section (about link/act LEDs)

Lack of functioning link and activity LEDs on devices without an EEPROM
is expected (not a bug).  Quoting the EVB-LAN7850 User's Guide:

    When configured with the default internal register settings, the
    Ethernet Link status LEDs are not enabled.  To enable Ethernet Link
    status LEDs, enable the EEPROM.

This is an artifact of the different ways in which the evaluation board
can be used.  End-user USB-Ethernet adapters using the Microchip LAN78XX
or LAN7515 controllers should use an EEPROM or have OTP configuration,
if their product configuration does not match the boot default register
configuration.

Sponsored by: The FreeBSD Foundation

6 years agoRevert size limits.
imp [Mon, 11 Jun 2018 20:38:30 +0000 (20:38 +0000)]
Revert size limits.

The size limits came from a flawed understanding of dump records.
The real issue was that dump was bogusly interpreting c_count
sometimes. r334978 fixes that.

6 years agoFix a bug in the counting of blks.
imp [Mon, 11 Jun 2018 20:38:26 +0000 (20:38 +0000)]
Fix a bug in the counting of blks.

We shouldn't count the bytes set in c_addr for TS_CLRI and TS_BITS
nodes. Those block overload c_count to communicate how many blocks
follow, not now many c_addr spaces are used. Dump would dump core
(now) because memory layout moved around and we'd access elements past
the end to make a count.

Reviewed by: kib@

6 years agoConnect muge.4 man page
emaste [Mon, 11 Jun 2018 20:19:20 +0000 (20:19 +0000)]
Connect muge.4 man page

Sponsored by: The FreeBSD Foundation

6 years agomuge.4: correct BUGS statement
emaste [Mon, 11 Jun 2018 19:48:15 +0000 (19:48 +0000)]
muge.4: correct BUGS statement

The EVB-LAN7850 I have does function with the EEPROM disabled - the
link / activity LEDs just do not function.

Sponsored by: The FreeBSD Foundation

6 years agoDon't initialize c_count. We don't need to.
imp [Mon, 11 Jun 2018 19:35:41 +0000 (19:35 +0000)]
Don't initialize c_count. We don't need to.

6 years agoif_muge: retire lan78xx_eeprom_read
emaste [Mon, 11 Jun 2018 19:34:47 +0000 (19:34 +0000)]
if_muge: retire lan78xx_eeprom_read

lan78xx_eeprom_read just checked for EEPROM presence then called
lan78xx_eeprom_read_raw if present, and had only one caller.  Introduce
lan78xx_eeprom_present to check for EEPROM presence, and use it in the
one place it is needed.

This is used by r334964, which was accidentally committed out-of-order
from my work tree.

Reported by: markj
Sponsored by: The FreeBSD Foundation

6 years agoMinor style polishing.
imp [Mon, 11 Jun 2018 19:32:49 +0000 (19:32 +0000)]
Minor style polishing.

Declare c_count and initialize it with other ints.

Reported by: mjg@

6 years agoDocument the newly enforced 524288 inode restriction.
imp [Mon, 11 Jun 2018 19:32:45 +0000 (19:32 +0000)]
Document the newly enforced 524288 inode restriction.

6 years agoDocument the dump issue in UPDATING so people understand when they
imp [Mon, 11 Jun 2018 19:32:40 +0000 (19:32 +0000)]
Document the dump issue in UPDATING so people understand when they
get a new diagnostic.

6 years agoAdd asserts to prevent overflows of c_addr.
imp [Mon, 11 Jun 2018 19:32:36 +0000 (19:32 +0000)]
Add asserts to prevent overflows of c_addr.

Add some asserts that prevents the overflows of c_addr. This can't
happen, absent bugs. However, certain large filesystems can cause
problems. These have been prevented by r334968, but a solution
is needed. These asserts will help assure that solution is correct.

PR: 228807
Reviewed by: db

6 years agoLarge file systems with inodes > 512K have been silently overflowing
db [Mon, 11 Jun 2018 19:12:50 +0000 (19:12 +0000)]
Large file systems with inodes > 512K have been silently overflowing
c_addr in spcl. So check before we start dumping otherwise we can
end up with a corrupted dump.

PR: 228807
Submitted by: db
Reviewed by: imp
Approved by: imp

6 years agoAdd a couple of safety belt checks to the NFSv4.1 client related to sessions.
rmacklem [Mon, 11 Jun 2018 19:00:07 +0000 (19:00 +0000)]
Add a couple of safety belt checks to the NFSv4.1 client related to sessions.

There were a couple of cases in newnfs_request() that it assumed that it
was an NFSv4.1 mount with a session. This should always be the case when
a Sequence operation is in the reply or the server replies NFSERR_BADSESSION.
However, if a server was broken and sent an erroneous reply, these safety
belt checks should avoid trouble.
The one check required a small tweak to nfsmnt_mdssession() so that it
returns NULL when there is no session instead of the offset of the field
in the structure (0x8 for i386).
This patch should have no effect on normal operation of the client.
Found by inspection during pNFS server development.

MFC after: 2 weeks

6 years agomakesyscalls: simplify capenabled pipeline
emaste [Mon, 11 Jun 2018 18:57:40 +0000 (18:57 +0000)]
makesyscalls: simplify capenabled pipeline

Replace cat + 2x grep with one grep.

Sponsored by: Turing Robotic Industries

6 years agoif_muge: add LAN7850 support
emaste [Mon, 11 Jun 2018 18:44:56 +0000 (18:44 +0000)]
if_muge: add LAN7850 support

Differences between LAN7800 and LAN7850 from the driver's perspective:

* The LAN7800 muxes EEPROM signals with LEDs, so LED mode needs to be
  disabled when reading/writing EEPROM.  The EEPROM is not muxed on the
  LAN7850.

* The Linux driver enables automatic duplex and speed detection when
  there is no EEPROM, for the LAN7800 only.  With this FreeBSD driver
  LAN7850-based adapters without a configuration EEPROM fail to link
  (with or without the automatic duplex and speed detection code), so
  I have just followed the example of the Linux driver for now.

Sponsored by: The FreeBSD Foundation
Sponsored by: Microchip (hardware)

6 years agolimit change to fixing controlp handling pending review
mmacy [Mon, 11 Jun 2018 17:10:19 +0000 (17:10 +0000)]
limit change to fixing controlp handling pending review

6 years agoProcess CUs with a language attribute of DW_LANG_Mips_Assembler.
markj [Mon, 11 Jun 2018 16:33:36 +0000 (16:33 +0000)]
Process CUs with a language attribute of DW_LANG_Mips_Assembler.

At the moment ctfconvert(1) does not do much with such CUs, but
that may not be true in the future, and we run ctfconvert on several
assembly files during the build.

X-MFC with: r334883

6 years agosoreceive_stream: correctly handle edge cases
mmacy [Mon, 11 Jun 2018 16:31:42 +0000 (16:31 +0000)]
soreceive_stream: correctly handle edge cases

- non NULL controlp is not an error, returning EINVAL
  would cause X forwarding to fail

- MSG_PEEK and MSG_WAITALL are fairly exceptional, but we still
  want to handle them - punt to soreceive_generic

6 years agoUse the cached curthread reference in pmc_process_interrupt().
markj [Mon, 11 Jun 2018 16:27:09 +0000 (16:27 +0000)]
Use the cached curthread reference in pmc_process_interrupt().

Fix indentation while here.

6 years agoImplement the kstrtobool() and kstrtobool_from_user() functions
hselasky [Mon, 11 Jun 2018 16:26:33 +0000 (16:26 +0000)]
Implement the kstrtobool() and kstrtobool_from_user() functions
in the LinuxKPI.

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

6 years agopmc gcc fixups
rlibby [Mon, 11 Jun 2018 16:09:54 +0000 (16:09 +0000)]
pmc gcc fixups

Fix the build of lib/libpmc and usr.sbin/pmc for gcc on amd64.

Reviewed by:    mmacy
Sponsored by:   Dell EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D15723

6 years agoImplement the user_access_begin(), user_access_end(), usafe_get_user() and
hselasky [Mon, 11 Jun 2018 15:42:29 +0000 (15:42 +0000)]
Implement the user_access_begin(), user_access_end(), usafe_get_user() and
unsafe_put_user() function macros in the LinuxKPI.

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

6 years agoFix braino in r334799. Maxmem is in pages.
kib [Mon, 11 Jun 2018 15:28:20 +0000 (15:28 +0000)]
Fix braino in r334799.  Maxmem is in pages.

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

6 years agoMore style(9) fixes, space vs tab.
araujo [Mon, 11 Jun 2018 15:18:31 +0000 (15:18 +0000)]
More style(9) fixes, space vs tab.

6 years agostyle(9): Fix tabs after #define.
pfg [Mon, 11 Jun 2018 14:45:34 +0000 (14:45 +0000)]
style(9): Fix tabs after #define.

No functional change intended.

6 years agoChange RACK dependency on TCPHPTS from a build-time dependency to a load-
jtl [Mon, 11 Jun 2018 14:27:19 +0000 (14:27 +0000)]
Change RACK dependency on TCPHPTS from a build-time dependency to a load-
time dependency.

At present, RACK requires the TCPHPTS option to run. However, because
modules can be moved from machine to machine, this dependency is really
best assessed at load time rather than at build time.

Reviewed by: rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15756

6 years agoFix build of bxe with base gcc on i386
dim [Mon, 11 Jun 2018 10:08:22 +0000 (10:08 +0000)]
Fix build of bxe with base gcc on i386

Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so print
these without casting.  The kva field of struct bxe_bar is of type
vm_offset_t, which can be 32 or 64 bit, so cast it to uintmax_t before
printing.

Reviewed by: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D15733

6 years agoDisable building aesni with base gcc
dim [Mon, 11 Jun 2018 08:42:03 +0000 (08:42 +0000)]
Disable building aesni with base gcc

Because base gcc does not support the required intrinsics, do not
attempt to compile the aesni module with it.

Noticed by: Dan Allen <danallen46@gmail.com>
MFC after: 3 days

6 years agoFix build of i915kms with base gcc
dim [Mon, 11 Jun 2018 08:11:35 +0000 (08:11 +0000)]
Fix build of i915kms with base gcc

Base gcc fails to compile sys/dev/drm2/i915/intel_display.c for i386,
with the following -Werror warnings:

cc1: warnings being treated as errors
/usr/src/sys/dev/drm2/i915/intel_display.c:8884: warning:
initialization from incompatible pointer type

This is due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432, which
incorrectly interprets the [] as a flexible array member.

Because base gcc does not have a -W flag to suppress this particular
warning, it requires a rather ugly cast.  To not influence any other
compiler, put it in a #if/#endif block.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D15744

6 years agoFix build of ocs_fs with base gcc on i386
dim [Mon, 11 Jun 2018 07:57:32 +0000 (07:57 +0000)]
Fix build of ocs_fs with base gcc on i386

Add a few intermediate casts to uintptr_t to suppress "cast to pointer
from integer of different size" warnings from gcc.  Also remove a few
incorrect casts.

Reviewed by: ram
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D15747

6 years agoindent(1): rename -nsac/-sac ("space after cast") to -ncs/-cs
pstef [Mon, 11 Jun 2018 05:35:57 +0000 (05:35 +0000)]
indent(1): rename -nsac/-sac ("space after cast") to -ncs/-cs

Also update tests and the manpage.

GNU indent had the option earlier as -cs, let's not diverge unnecessarily.

6 years agousbdevs: sort my prior commit
eadler [Mon, 11 Jun 2018 05:28:00 +0000 (05:28 +0000)]
usbdevs: sort my prior commit

6 years agousbdevs: adding vendor
eadler [Mon, 11 Jun 2018 05:27:07 +0000 (05:27 +0000)]
usbdevs: adding vendor

PR: 228856
Reported by: hrs, ys-h@imail.earth

6 years agotop(1): handle 0 in "digits" functions
eadler [Mon, 11 Jun 2018 05:05:20 +0000 (05:05 +0000)]
top(1): handle 0 in "digits" functions

6 years ago- Add bhyve virtio-scsi storage backend support.
araujo [Mon, 11 Jun 2018 02:09:20 +0000 (02:09 +0000)]
- Add bhyve virtio-scsi storage backend support.

Example of configuration:
ctl.conf:
portal-group pg0 {
        discovery-auth-group no-authentication
        listen 0.0.0.0
        listen [::]
}

target iqn.2012-06.com.example:target0 {
        auth-group no-authentication
        portal-group pg0
        port ioctl/5/3

        lun 0 {
                path /z/test.img
                size 8G
        }
        lun 1 {
                path /z/test1.img
                size 8G
        }
}

bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 <VM_NAME>

From inside guest:
root@:~ # zpool status test
  pool: test
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        test        ONLINE       0     0     0
          da0       ONLINE       0     0     0
          da1       ONLINE       0     0     0

dmesg:
da0 at vtscsi0 bus 0 scbus0 target 0 lun 0
da0: <FREEBSD CTLDISK 0001> Fixed Direct Access SPC-5 SCSI device
da0: Serial Number MYSERIAL0000
da0: 300.000MB/s transfers
da0: Command Queueing enabled
da0: 8192MB (16777216 512 byte sectors)
da1 at vtscsi0 bus 0 scbus0 target 0 lun 1
da1: <FREEBSD CTLDISK 0001> Fixed Direct Access SPC-5 SCSI device
da1: Serial Number MYSERIAL0001
da1: 300.000MB/s transfers
da1: Command Queueing enabled
da1: 8192MB (16777216 512 byte sectors)

Discussed with: grehan
Reviewed by: mav
Obtained from: TrueOS
Relnotes: Yes
Sponsored by: iXsystems Inc.
Tested with: FreeBSD HEAD, Fedora 28 (Workstation) and
Ubuntu 18.04.
Differential Revision:  https://reviews.freebsd.org/D15276

6 years agolualoader: Allow brand-*.lua for adding new brands
kevans [Mon, 11 Jun 2018 01:32:18 +0000 (01:32 +0000)]
lualoader: Allow brand-*.lua for adding new brands

dteske@, I believe, had originally pointed out that lualoader failed to
allow logo-*.lua for new logos to be added. When correcting this mistake, I
failed to do the same for brands.

Correct the sub-mistake: creating new brands is almost identical to creating
new logos, except one must use `drawer.addBrand` and 'graphic' is the only
valid key for a branddef at the moment.

While here, I've added `drawer.default_brand` to be set to name of brand to
be used (e.g. 'fbsd', project default).

Eventually this whole goolash will be documented.

Reported by: kmoore, iXsystems

6 years agoaudit(4): add tests for stat(2) and friends
asomers [Sun, 10 Jun 2018 21:36:29 +0000 (21:36 +0000)]
audit(4): add tests for stat(2) and friends

This revision adds auditability tests for stat, lstat, fstat, and fstatat,
all from the fa audit class.  More tests from that audit class will follow.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15709

6 years agoRemove the psci option from arm64. It is now a standard option as it is
andrew [Sun, 10 Jun 2018 19:42:44 +0000 (19:42 +0000)]
Remove the psci option from arm64. It is now a standard option as it is
required to boot correctly.

Sponsored by: DARPA, AFRL

6 years agoRevert r334929
eadler [Sun, 10 Jun 2018 19:15:38 +0000 (19:15 +0000)]
Revert r334929

Apparently some software might depend on a header whose sole contents is
a `#warning` to remove it. Revert pending exp-run.

6 years agoAdd checks for the Flexible File layout to LayoutRecall callbacks.
rmacklem [Sun, 10 Jun 2018 19:03:21 +0000 (19:03 +0000)]
Add checks for the Flexible File layout to LayoutRecall callbacks.

The Flexible File layout case wasn't handled by LayoutRecall callbacks
because it just checked for File layout and returned NFSERR_NOMATCHLAYOUT
otherwise. This patch adds the Flexible File layout handling.
Found during testing of the pNFS server.

MFC after: 2 weeks

6 years agoinclude: remove sys/capability.h
eadler [Sun, 10 Jun 2018 18:38:48 +0000 (18:38 +0000)]
include: remove sys/capability.h

This file has only generated a warning for the last 18 months. Its
existence at this point only serves to confuse software looking for
POSIX.1e capabilities and produce actionless warnings.

6 years agolibc qsort(3): stop aliasing.
kib [Sun, 10 Jun 2018 17:54:44 +0000 (17:54 +0000)]
libc qsort(3): stop aliasing.

Qsort swap code aliases the sorted array elements to ints and longs in
order to do swap by machine words.  Unfortunately this breaks with the
full code optimization, e.g. LTO.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83201 which seems to
reference code directly copied from libc/stdlib/qsort.c.

PR: 228780
Reported by: mliska@suse.cz
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15714

6 years agoindent(1): group global option variables into an options structure
pstef [Sun, 10 Jun 2018 16:44:18 +0000 (16:44 +0000)]
indent(1): group global option variables into an options structure

It's clearer now when a variable represents a toggable command line option.

Many options were stored in the parser's state structure, so fix also that.

6 years agoClean up handling of unexpected exceptions. Previously we would issue a
andrew [Sun, 10 Jun 2018 16:21:21 +0000 (16:21 +0000)]
Clean up handling of unexpected exceptions. Previously we would issue a
breakpoint instruction, however this would lose information that may be
useful for debugging.

These are now handled in a similar way to other exceptions, however it
won't exit out of the exception handler until it is known if we can
handle these exceptions in a useful way.

Sponsored by: DARPA, AFRL

6 years agoUntangle configuration ifdefs a little. On x86, msi is optional on pci,
bde [Sun, 10 Jun 2018 14:49:13 +0000 (14:49 +0000)]
Untangle configuration ifdefs a little.  On x86, msi is optional on pci,
and also on apic in common and i386 files (except for xen it is optional
only on xenhvm), but it was not ifdefed except on apic in common and i386
files.

This is all that is left from an attempt to build a (sub-)minimal kernel
without any devices.  The isa "option" is still used without ifdefs in many
standard files even on amd64.  ISAPNP is not optional on at least i386.
ATPIC is not optional on i386 (it is used mainly for Xspuriousint).  But
pci is now supposed to be optional on x86.

6 years agoFix panics in potentially all x86bios calls on i386 since r332489.
bde [Sun, 10 Jun 2018 14:21:01 +0000 (14:21 +0000)]
Fix panics in potentially all x86bios calls on i386 since r332489.

A call to npxsave() in the exception trampolines was not relocated.
This call to a garbage address usually paniced when made, but it is only
made when the thread has used an FPU recently, and this is not the usual
case.

PR: 228755
Reviewed by: kib

6 years agoDrop MOUSE_GETVARS and MOUSE_SETVARS ioctls support.
wulf [Sun, 10 Jun 2018 10:23:31 +0000 (10:23 +0000)]
Drop MOUSE_GETVARS and MOUSE_SETVARS ioctls support.

These ioctls are not documented and only stubbed in a few drivers: mse(4),
psm(4) and syscon's sysmouse(4). The only exception is MOUSE_GETVARS
implemented in psm(4)

Given the fact that they were introduced 20 years ago and implementation
has never been completed, remove any related code.

PR: 228718 (exp-run)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D15726

6 years agotop(1): use modern interfaces for nice and related
eadler [Sun, 10 Jun 2018 09:15:13 +0000 (09:15 +0000)]
top(1): use modern interfaces for nice and related

- attempt and fail, rather than check for permission.
- use macro rather than explicit "-20"

6 years agotop(1): add command aliases; correct dumb support
eadler [Sun, 10 Jun 2018 09:04:56 +0000 (09:04 +0000)]
top(1): add command aliases; correct dumb support

6 years agotop(1): use sys_signame instead of hard coding signals
eadler [Sun, 10 Jun 2018 09:00:01 +0000 (09:00 +0000)]
top(1): use sys_signame instead of hard coding signals

This enables the removal of the signal.h awk script. Shamelessly stolen
from kill(1).

6 years agotop(1): bring some structure to commands
eadler [Sun, 10 Jun 2018 08:59:57 +0000 (08:59 +0000)]
top(1): bring some structure to commands

Right now this is only used for help text but it'll eventually be used
to build up long options array, dispatch commands, etc.

6 years agotop(1): use correct word when displaying threads
eadler [Sun, 10 Jun 2018 06:33:49 +0000 (06:33 +0000)]
top(1): use correct word when displaying threads

PR: 182204
Reported by: "Brodey Dover" <doverosx@gmail.com>

6 years agotop(1): filter fewer warnings; clean up
eadler [Sun, 10 Jun 2018 06:21:51 +0000 (06:21 +0000)]
top(1): filter fewer warnings; clean up

- remove WARNS?=6. It is default
- we no longer have cast-qual problems
- remove unused macros
- remove unneeded casts
- add include guard for loadavg.h

6 years agotop(1): permit sending signal with any case
eadler [Sun, 10 Jun 2018 06:21:45 +0000 (06:21 +0000)]
top(1): permit sending signal with any case

6 years agoAdd myself to calendar.freebsd
dexter [Sun, 10 Jun 2018 05:48:03 +0000 (05:48 +0000)]
Add myself to calendar.freebsd

Approved by: bcr (mentor)

6 years agoAdd myself with mentor. Corrected path svnadmin/conf/access in comments.
dexter [Sun, 10 Jun 2018 05:37:40 +0000 (05:37 +0000)]
Add myself with mentor. Corrected path svnadmin/conf/access in comments.

Approved by: bcr (mentor)

6 years agoPass on bhyve kernel module maintenance to
grehan [Sun, 10 Jun 2018 04:25:19 +0000 (04:25 +0000)]
Pass on bhyve kernel module maintenance to
tychon and jhb who've both had a long history
with the codebase.

Discussed with:  tychon, jhb

6 years agolualoader: Support variable substitution in env var settings
kevans [Sun, 10 Jun 2018 02:36:38 +0000 (02:36 +0000)]
lualoader: Support variable substitution in env var settings

We support both of the following cases of substitution:

bar="y"
foo="${bar}"
foo="$bar"

The latter substitution syntax is, of course, not recommended- all
punctuation must be considered potential variable names, and we do not go
through the effort of searching the different combinations of, for instance,
"$x.y.z" to determine if the variable is $x, $x.y, or $x.y.z.

This is not officially documented as supported, but it has worked in
forthloader for what is most likely a long time as `evaluate` is used to
process the right hand side of the assignment.

6 years agoUse __SCSSID() for SCCS IDs.
jhb [Sun, 10 Jun 2018 02:34:41 +0000 (02:34 +0000)]
Use __SCSSID() for SCCS IDs.

While here, fix $FreeBSD$ ID in ftime.c to use __FBSDID instead of a static
array.

6 years agoRemove old, dead compat code.
imp [Sun, 10 Jun 2018 02:30:09 +0000 (02:30 +0000)]
Remove old, dead compat code.

We no longer need to od these things conditionally, and the fallbacks
are to 4.2BSD era defaults, which nobody uses anymore. Vixie cron has
diverged from upstream anyway in our tree, and it's not clear there's
actually a viable upstream anymore. Plus, we don't follow the
vendor-supplied code pattern here.

I'm doing this to reduce false positives from grep.

6 years agoSet the $PATH in /etc/crontab like it is set by the cron(8)
imp [Sun, 10 Jun 2018 02:13:30 +0000 (02:13 +0000)]
Set the  $PATH in /etc/crontab like it is set by the cron(8)
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: https://github.com/freebsd/freebsd/pull/155

6 years agolualoader: Process loader_conf_files properly
kevans [Sun, 10 Jun 2018 01:38:52 +0000 (01:38 +0000)]
lualoader: Process loader_conf_files properly

loader.conf(5) documents loader_conf_files to mean "additional configuration
files to be processed right after the present file." However, lualoader
ignored loader_conf_files after processing /boot/defaults/loader.conf.

Rewrite these bits to process loader_conf_files after each loaded file.

6 years agotop(1): permit sub-second delay times
eadler [Sun, 10 Jun 2018 00:02:56 +0000 (00:02 +0000)]
top(1): permit sub-second delay times

This removes the getuid check for delay==0. It didn't prevent users from
writing similar programs in the general case. In theory, if top(1) is
among one of the few restricted programs you're allowed to run, it may
have helped a little, but there are better ways of handling that case.

6 years agoDelete some macros that are unused.
rmacklem [Sat, 9 Jun 2018 23:38:22 +0000 (23:38 +0000)]
Delete some macros that are unused.

These macros were added because they were used by the pNFS server last
year. However, they are no longer used by the pNFS server code and
might as well be deleted.
This is a partial reversion of r326735.

6 years agotop(1): correctly reset per-cpu counters
eadler [Sat, 9 Jun 2018 23:24:08 +0000 (23:24 +0000)]
top(1): correctly reset per-cpu counters

I had changed this from a for loop to a memset during an earlier
cleanup. This change was incorrect so revert it.

While here, clean up

Reported by: flo

6 years agoDelete an unused macro and clean up a comment about it.
rmacklem [Sat, 9 Jun 2018 23:14:59 +0000 (23:14 +0000)]
Delete an unused macro and clean up a comment about it.

NFSDEV_MIRRORSTR was defined for the pNFS server, but has not been used,
so this patch deletes it. It also cleans up the comment and hopefully
makes it more readable.

6 years agotop(1): handle specific pids better
eadler [Sat, 9 Jun 2018 23:08:02 +0000 (23:08 +0000)]
top(1): handle specific pids better

When told to watch a specific pid, don't filter idle, system, or self
processes. The summary at the top will still flip correctly though.

6 years agotop(1): implement additional missing long options
eadler [Sat, 9 Jun 2018 22:30:10 +0000 (22:30 +0000)]
top(1): implement additional missing long options

6 years agotop(1): initial pass to freebsdize the man page
eadler [Sat, 9 Jun 2018 21:40:33 +0000 (21:40 +0000)]
top(1): initial pass to freebsdize the man page

The previous man page used many conventions not typical in FreeBSD.
Since we've forked top completely, convert the man page too.

6 years agotop(1): Implement long options
eadler [Sat, 9 Jun 2018 21:40:24 +0000 (21:40 +0000)]
top(1): Implement long options

This also documents some reserved or differing options from top's
original upstream.

6 years agodiff: Import fixes from OpenBSD
bapt [Sat, 9 Jun 2018 21:09:24 +0000 (21:09 +0000)]
diff: Import fixes from OpenBSD

original commit log by miller@OpenBSD  r1.46:
Fix exit value when diffing directories with missing files and the -N
or -P options are not used.  From Ibrahim Khalifa

6 years agoAdd myself to the calendar
ygy [Sat, 9 Jun 2018 21:05:25 +0000 (21:05 +0000)]
Add myself to the calendar

Requested by: mckusick
Reviewed by: emaste

6 years agoIsolate the pr(1) related code in its own source files
bapt [Sat, 9 Jun 2018 20:24:17 +0000 (20:24 +0000)]
Isolate the pr(1) related code in its own source files

This keeps diffreg.c closer to what it is supposed to do:
diffing regular files.

It also allows my code to get a proper license

6 years agotop(1): allow starting with -T flag
eadler [Sat, 9 Jun 2018 20:06:06 +0000 (20:06 +0000)]
top(1): allow starting with -T flag

6 years agoBump __FreeBSD_version after r334881 and force libdwarf to be rebuilt.
markj [Sat, 9 Jun 2018 20:01:03 +0000 (20:01 +0000)]
Bump __FreeBSD_version after r334881 and force libdwarf to be rebuilt.

Reported by: O. Hartmann <ohartmann@walstatt.org>
Reviewed by: bdrewery

6 years agolualoader: Add cli.lua(8) to the tree
kevans [Sat, 9 Jun 2018 19:51:09 +0000 (19:51 +0000)]
lualoader: Add cli.lua(8) to the tree

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