Displaying 1 50 of 324,624 commits (0.020s)

FreeBSD — head/sys/dev/extres/clk clk.c

clk: Get new parent freq after set_freq

During set_freq a clknode might have reparent (using a better parent that
have a higher frequency for example), before refreshing the cache, re-get
the parent frequency.

Reviewed by:        mmel
Delta File
+8 -0 head/sys/dev/extres/clk/clk.c
+8 -0 1 file

FreeBSD — head/sys/dev/usb/template usb_template_serialnet.c

Remove unused index.

MFC after:        2 weeks
Sponsored by:        The FreeBSD Foundation

FreeBSD — head/sys/dev/usb/template usb_template_midi.c usb_template_phone.c

Add missing SPDX tags; the rest of the license text is the same as in other
USB templates.

MFC after:        2 weeks
Sponsored by:        The FreeBSD Foundation

FreeBSD — head/sys/arm/conf RPI-B

Add usb_template(4) to RPI-B kernel config.  This is to support the USB OTG
functionality on Raspberry Pi 0.

Reviewed by:        hselasky@
MFC after:        2 weeks
Sponsored by:        The FreeBSD Foundation
Differential Revision:        https://reviews.freebsd.org/D13924
Delta File
+3 -0 head/sys/arm/conf/RPI-B
+3 -0 1 file

FreeBSD — head/share/man/man4 usb_template.4, head/sys/dev/usb/template usb_template_serialnet.c usb_template_cdce.c

Add sysctls to control device side USB identifiers. This makes it
possible to change string and numeric vendor and product identifiers,
as well as anything else there might be to change for a particular
device side template, eg the MAC address.

Reviewed by:        hselasky@
MFC after:        2 weeks
Sponsored by:        The FreeBSD Foundation
Differential Revision:        https://reviews.freebsd.org/D13920

FreeBSD — stable/11/sys/kern subr_kdb.c

MFC r327917:
Add sysctl debug.kdb.stack_overflow.
Delta File
+35 -0 stable/11/sys/kern/subr_kdb.c
+35 -0 1 file

FreeBSD — head/sys/vm vm_map.c vm_map.h

Assign map->header values to avoid boundary checks.

In several places, entry start and end field are checked, after
excluding the possibility that the entry is map->header.  By assigning
max and min values to the start and end fields of map->header in
vm_map_init, the explicit map->header checks become unnecessary.

Submitted by:        Doug Moore <dougm at rice.edu>
Reviewed by:        alc, kib, markj (previous version)
Tested by:        pho (previous version)
MFC after:        1 week
Differential Revision:  https://reviews.freebsd.org/D13735

FreeBSD — head/sys/dev/atkbdc psm.c

psm: Don't try to detect trackpoint packets if the Elantech device has none

This fixes a panic when `EVDEV_SUPPORT` is enabled: if a trackpoint
packet was detected but there was no trackpoint, we still tried to emit an
evdev event even though the associated relative evdev device (`evdev_r`)
was not initialized.

PR:                225339
MFC after:        1 week
Delta File
+1 -1 head/sys/dev/atkbdc/psm.c
+1 -1 1 file

FreeBSD — head/sys/dev/atkbdc psm.c

psm: Skip sync check when `PSM_CONFIG_NOCHECKSYNC` is set

In psmprobe(), we set the initial `syncmask` to the vendor default value
if the `PSM_CONFIG_NOCHECKSYNC` bit is unset. However, we currently only
set it for the Elantech touchpad later in psmattach(), thus `syncmask`
is always configured.

Now, we check `PSM_CONFIG_NOCHECKSYNC` and skip sync check if it is set.
This fixes Elantech touchpad support for units which have `hascrc` set.

To clarify that, when we log the `syncmask` and `syncbits` fields, also
mention if they are actually used.

Finally, when we set `PSM_CONFIG_NOCHECKSYNC`, clear `PSM_NEED_SYNCBITS`
flag.

PR:                225338
MFC after:        1 week
Delta File
+8 -4 head/sys/dev/atkbdc/psm.c
+8 -4 1 file

FreeBSD — head/usr.bin/hexdump/tests od_test.sh

od(1): Fix mis-patch from r328188

od_test.sh got duplicated erroneously when it was added in r328188. Dedup.

FreeBSD — head/usr.bin/hexdump conv.c, head/usr.bin/hexdump/tests od_test.sh Makefile

od(1): Fix wrong output for some corner cases in multibyte locales.

Restore the original character to print if we used the look-ahead
buffer, but that didn't help -- we either got an illegal sequence
or still can't complete.

PR:                224552
Submitted by:        Yuri Pankov
MFC after:        1 week
Differential Revision:        https://reviews.freebsd.org/D13963

FreeBSD — head/sys/dev/bhnd/cores/chipc chipc.c

bhnd_chipc(4): Fix leak of child device ivars by explicitly deleting
any children prior to detach.

With the newbus child deletion ordering changes introduced in r307518,
parent devices are now detached (and their driver set to NULL) prior to
detaching and deleting child devices; child-related bus methods (e.g.
BUS_CHILD_DETACHED, BUS_CHILD_DELETED) are no longer be dispatched to the
parent device driver after it returns 0 (success) from DEVICE_DETACH.

Sponsored by:   The FreeBSD Foundation

FreeBSD — stable/11/usr.bin/limits limits.1

MFC r327946 r327947:

limits(1): fix grammar

PR:           225147
Delta File
+3 -3 stable/11/usr.bin/limits/limits.1
+3 -3 1 file

FreeBSD — user/jeff/numa Makefile.libcompat Makefile.inc1, user/jeff/numa/bin/ls print.c ls.c

Merge from head.

FreeBSD — user/jeff/numa/sys/vm vm_page.c vm_reserv.c

Refactor for clarity and to eliminate needless array lookups.

FreeBSD — head/share/man/man9 bhnd.9, head/sys/dev/bhnd bhnd_ids.h bhnd_subr.c

bhnd/bwn(4): Define a bhnd(4) softmodem device class for the v.90 modem
codec core, and mark the core as unpopulated on all BCM4306 bwn(4) devices.

Sponsored by:        The FreeBSD Foundation

FreeBSD — head/sys/dev/bwn if_bwn_pci.c

bwn(4): Add missing BCM4306 PCI IDs.

Sponsored by:        The FreeBSD Foundation
Delta File
+3 -0 head/sys/dev/bwn/if_bwn_pci.c
+3 -0 1 file

FreeBSD — head/sys/dev/bwn if_bwn_siba_compat.c

bwn(4): Fix DMA translation lookup on devices limited to 30-bit host
addressing. The host addressing constraint does not apply to device address
space, and shouldn't be passed to bhnd_get_dma_translation() as the
maximum supported device address width.

Sponsored by:        The FreeBSD Foundation

FreeBSD — head/sys/dev/bhnd/bhndb bhndb_pci.c

bhndb_pci(4): Implement bridge support for CardBus-attached devices.

 - Extend the probe method to accept devclasses that inherit from the pci
   devclass (e.g. cardbus).
 - Some BCM4306-based CardBus adapters appear to advertise 4K SPROM, but
   only the first 2K is mapped into BAR0. We can safely assume that the
   SPROM data fits within the first 2K of the SPROM, rather than rejecting
   the SPROM mapping as invalid.

Sponsored by:        The FreeBSD Foundation
Delta File
+19 -10 head/sys/dev/bhnd/bhndb/bhndb_pci.c
+19 -10 1 file

FreeBSD — head/sys/powerpc/aim trap_subr64.S

On AIM systems without a software-managed SLB, such as POWER9 systems using
either hardware segment tables or radix-tree-based page tables, do not try
to install SLB entries at trap boundaries.

FreeBSD — head/sys/arm/include vmparam.h, head/sys/compat/linuxkpi/common/src linux_page.c

Define PHYS_TO_DMAP() and DMAP_TO_PHYS() as panics on the architectures
(i386 and arm) that never implement them. This allows the removal of
#ifdef PHYS_TO_DMAP on code otherwise protected by a runtime check on
PMAP_HAS_DMAP. It also fixes the build on ARM and i386 after I forgot an
#ifdef in r328168.

Reported by:        Milan Obuch
Pointy hat to:        me

FreeBSD — head/sys/amd64/amd64 exception.S trap.c, head/sys/amd64/include asmacros.h pcpu.h

PTI: Trap if we returned to userspace with kernel (full) page table
still active.

Map userspace portion of VA in the PTI kernel-mode page table as
non-executable. This way, if we ever miss reloading ucr3 into %cr3 on
the return to usermode, the process traps instead of executing in
potentially vulnerable setup.  Catch the condition of such trap and
verify user-mode %cr3, which is saved by page fault handler.

I peek this trick in some article about Linux implementation.

Reviewed by:        alc, markj (previous version)
Sponsored by:        The FreeBSD Foundation
MFC after:        12 days
DIfferential revision:        https://reviews.freebsd.org/D13956

FreeBSD — head/sys/dev/bhnd/cores/chipc/pwrctl bhnd_pwrctl.c, head/sys/dev/bhnd/siba siba.c

bhnd(4): fix a few bugs in pwrctl/fixed-clock device support.

 - Do not panic on siba(4) detach when the bhnd(4) bus calls
   bhnd_get_pmu_info() on a PMU-less device.
 - Fix bhnd_pwrctl attach/detach on fixed-clock devices:
    - Treat bhnd_pwrctl_updateclk() as a no-op on fixed-clock devices.
    - Use bhnd_pwrctl_updateclk() to perform the appropriate clock
      transition on detach.

Sponsored by:        The FreeBSD Foundation

FreeBSD — user/jeff/numa/sys/vm vm_page.c

Implement the global vm_wait() and vm_waitpfault().  Document existing
deficiencies in the design.  Optimize out wakeups.
Delta File
+51 -16 user/jeff/numa/sys/vm/vm_page.c
+51 -16 1 file

FreeBSD — head/sys/dev/bhnd/cores/chipc chipc.c

bhnd_chipc(4): Fix the assignment of non-wildcard child unit numbers
introduced in r326102 and r326109; all chipc children should be added with
a wildcard unit (-1).

Sponsored by:        The FreeBSD Foundation

FreeBSD — head/usr.bin/dtc fdt.cc dtc.1

dtc(1): Update to upstream ea3c233

Highlights of this update:
- /__local_fixups__ is now generated to be GPL dtc and libfdt compliant
- Compiling with -@ will now cause dtc to assign phandles to all labelled
  nodes
- /include/ and /incbin/ now handle absolute paths correctly
- The manpage now has information about overlays, including how to apply
  them and how to generate them
- Syntactic sugar for overlays is now supported, allowing an overlay DTS
  like:

=
/dts-v1/;
/plugin/;

&foo {
    foo,status = "okay";
};
=

to generate a fragment targetting <&foo>.

FreeBSD — user/jeff/numa/sys/kern subr_vmem.c, user/jeff/numa/sys/sys vmmeter.h

Use bitsets for min and severe limit checks so that we can quickly
determine if any domains are in shortfall and synchronously sleep on
this condition.

Provide some new vm_wait_* functions that are more precise for specific
scenarios.

FreeBSD — head/contrib/bsnmp/snmpd action.c main.c

Rename "index" variable to "idx" since gcc complains that it shadows
index(3) function declaration.

Reported by:        lwhsu
MFC after:        2 weeks

FreeBSD — head/sys/cam/mmc mmc_xpt.c

Fix compile errors in r328165

Reported by:        O. Hartmann
Sponsored by:        Netflix
Delta File
+2 -4 head/sys/cam/mmc/mmc_xpt.c
+2 -4 1 file

FreeBSD — head/stand/efi/loader/arch/i386 bootinfo.c

Remove extra copy of bootinfo.c. It's a bit rotted copy of the one in
efi/loader.

Differential Review: https://reviews.freebsd.org/D13986

FreeBSD — head/sys/amd64/include vmparam.h, head/sys/arm/include vmparam.h

Remove SFBUF_OPTIONAL_DIRECT_MAP and such hacks, replacing them across the
kernel by PHYS_TO_DMAP() as previously present on amd64, arm64, riscv, and
powerpc64. This introduces a new MI macro (PMAP_HAS_DMAP) that can be
evaluated at runtime to determine if the architecture has a direct map;
if it does not (or does) unconditionally and PMAP_HAS_DMAP is either 0 or
1, the compiler can remove the conditional logic.

As part of this, implement PHYS_TO_DMAP() on sparc64 and mips64, which had
similar things but spelled differently. 32-bit MIPS has a partial direct-map
that maps poorly to this concept and is unchanged.

Reviewed by:                kib
Suggestions from:        marius, alc, kib
Runtime tested on:        amd64, powerpc64, powerpc, mips64

FreeBSD — stable/11/sys/dev/aac aac.c

MFC r323317 (by scottl): Move the intrhook release to later in the function
so that GEOM knows to wait longer for possible root devices to come online.
This fixes a race that seems to be triggered by EARLY_AP_STARTUP.

Submitted by:        cgull at glup.org
Delta File
+5 -5 stable/11/sys/dev/aac/aac.c
+5 -5 1 file

FreeBSD — head/sys/amd64/amd64 machdep.c, head/sys/x86/include x86_var.h

Enable KPTI by default on amd64 for non-AMD CPUs

Kernel Page Table Isolation (KPTI) was introduced in r328083 as a
mitigation for the 'Meltdown' vulnerability.  AMD CPUs are not affected,
per https://www.amd.com/en/corporate/speculative-execution:

    We believe AMD processors are not susceptible due to our use of
    privilege level protections within paging architecture and no
    mitigation is required.

Thus default KPTI to off for AMD CPUs, and to on for others.  This may
be refined later as we obtain more specific information on the sets of
CPUs that are and are not affected.

Submitted by:        Mitchell Horne
Reviewed by:        cem
Relnotes:        Yes
Security:        CVE-2017-5754
Sponsored by:        The FreeBSD Foundation
Differential Revision:        https://reviews.freebsd.org/D13971

FreeBSD — head/sbin/camcontrol camcontrol.c, head/sys/cam cam_xpt.c cam_ccb.h

Revert ABI breakage to CAM that came in with MMC/SD support in r320844.
Make it possible to retrieve mmc parameters via the XPT_GET_ADVINFO
call instead.  Convert camcontrol to the new scheme.

Reviewed by:        imp. kibab
Sponsored by:        Netflix
Differential Revision:        D13868

FreeBSD — head/sys/contrib/libnv nv_impl.h

libnv: Use mallocarray(9) for the nv_calloc.
Delta File
+1 -1 head/sys/contrib/libnv/nv_impl.h
+1 -1 1 file

FreeBSD — head/sys/dev/usb usbdevs, head/sys/dev/usb/serial u3g.c

Add new USB ID to U3G driver.

PR:                134299
MFC after:        1 week
Sponsored by:        Mellanox Technologies

FreeBSD — head/sys/dev/usb/net if_cdce.c, head/sys/dev/usb/serial u3g.c umodem.c

Improve support for USB based 3G/4G/5G dongles from Huawei.

PR:                192345
Sponsored by:        Mellanox Technologies

FreeBSD — head/sys/netpfil/ipfw ip_fw2.c ip_fw_log.c

Add UDPLite support to ipfw(4).

Now it is possible to use UDPLite's port numbers in rules,
create dynamic states for UDPLite packets and see "UDPLite" for matched
packets in log.

Obtained from:        Yandex LLC
MFC after:        2 weeks
Sponsored by:        Yandex LLC

FreeBSD — head/contrib/bsnmp/snmpd main.c action.c

Add to bsnmpd(1) ability to specify multiple community strings with
different access rights.

By default there are two community strings with index 1 and 2, one for
read-only access and second for read-write access:

  begemotSnmpdCommunityString.0.1 = $(read)
  begemotSnmpdCommunityString.0.2 = $(write)

Now it is possible to define additional community strings using different
indexes:

  begemotSnmpdCommunityString.0.3 = "SomeString1"
  begemotSnmpdCommunityPermission.0.3 = 1
  begemotSnmpdCommunityString.0.4 = "SomeString2"
  begemotSnmpdCommunityPermission.0.4 = 2
  begemotSnmpdCommunityString.0.5 = "SomeString3"
  begemotSnmpdCommunityString.0.6 = "SomeString4"

New attribute begemotSnmpdCommunityPermission can be used to specify access
rights: 1 means "read-only" access, 2 means "read-write" access. If
attribute is not specified for some index this means "read-only" rights.

Community strings must be unique, i.e. must not be the same for different
indexes.

    [5 lines not shown]

FreeBSD — head/sys/modules Makefile

Unbreak i386 build

The logical result of a right shift >= the width of a type is zero, but our
compiler decides this is a warning (and thus, error).  Just remove ccp(4)
from i386.

Reported by:        cy
Sponsored by:        Dell EMC Isilon
Delta File
+1 -1 head/sys/modules/Makefile
+1 -1 1 file

FreeBSD — head/gnu/usr.bin/gdb/kgdb trgt_amd64.c

Recognize mchk_calltrap as a trapframe generator.

Should have been included in r328157.

FreeBSD — head/sys/amd64/amd64 exception.S machdep.c, head/sys/amd64/include intr_machdep.h

Use a dedicated per-CPU stack for machine check exceptions.

Similar to NMIs, machine check exceptions can fire at any time and are
not masked by IF.  This means that machine checks can fire when the
kstack is too deep to hold a trap frame, or at critical sections in
trap handlers when a user %gs is used with a kernel %cs.  Use the same
strategy used for NMIs of using a dedicated per-CPU stack configured
in IST 3.  Store the CPU's pcpu pointer at the stop of the stack so
that the machine check handler can reliably find the proper value for
%gs (also borrowed from NMIs).

This should also fix a similar issue with PTI with a MC# occurring
while the CPU is executing on the trampoline stack.

While here, bypass trap() entirely and just call mca_intr().  This
avoids a bogus call to kdb_reenter() (there's no reason to try to
reenter kdb if a MC# is raised).

Reviewed by:        kib
Tested by:        avg (on AMD without PTI)
Differential Revision:        https://reviews.freebsd.org/D13962

FreeBSD — head/stand/arm/uboot ldscript.arm, head/stand/efi/loader/arch/arm ldscript.arm

stand: Move sections around to fix stand/ build with ld.lld on armv7

When building loader bits, lld fails with the following error:
"ld: error: section: .dynamic is not contiguous with other relro sections"
on both ubldr and EFI loader.

Move .dynamic up to make ld.lld happy, adjust .got as necessary for ubldr.

Tested on:        OrangePi One (ld.lld, ubldr)
Tested on:        Banana Pi-M3 (ld.lld, ubldr)
Tested on:        qemu-armv7 (ld.lld, EFI)
Tested on:        qemu-armv7 (ld.bfd, EFI)
Tested on:        Raspberry Pi 2 (ld.bfd, ubldr) [manu]
Tested on:        Banana Pi-M2 (ld.bfd, ubldr) [manu]
Reviewed by:        andrew, emaste, imp
Differential Revision:        https://reviews.freebsd.org/D13942

FreeBSD — head/share/man/man9 style.9

No need for the zero width space now that I put the comma in.
Delta File
+2 -2 head/share/man/man9/style.9
+2 -2 1 file

FreeBSD — head/share/man/man9 style.9

Make igor happier with this file:
o Don't use contractions.
o Add common after e.g. where needed
Delta File
+7 -7 head/share/man/man9/style.9
+7 -7 1 file

FreeBSD — head/sys/amd64/amd64 exception.S

Remove two no-longer-used labels from the NMI interrupt handler.

Reviewed by:        kib
Delta File
+1 -3 head/sys/amd64/amd64/exception.S
+1 -3 1 file

FreeBSD — stable/11/lib/libc/regex engine.c

MFC r322288: regex(3): Refactor fast/slow stepping bits in matching engine

Adding features for matching is fairly straightforward, but this requires
some duplication because of this fast/slow setup. They can be fairly
trivially combined into a single walk(), so do it to make future additions
less error prone.
Delta File
+50 -142 stable/11/lib/libc/regex/engine.c
+50 -142 1 file

FreeBSD — stable/11/lib/libc/regex regcomp.c regex2.h

MFC r320742, r320750, r320796: Refactor regex(3) for maintainability

MFC r320742:
The impending libregex will implement GNU extensions to bring BREs and
EREs closer together. Prepare for this and reduce the diff of libregex
changes by refactoring and combining the top-level parsers for EREs/BREs
ahead of time.

Branching functionality has been split out to make it easier to follow the
combined version of the top-level parser. It may also be enabled in the
parsing context to make it easier when libregex enables branching for BREs.

A branching context was also added for the various branching functions and
so that BREs, for instance, can determine if they're the first expression in
a chain of expressions within the current branch and treat '*' as ordinary
if so.

This should have no functional impact and negligible performance impact.

MFC r320750: Fix sparc64 libc build after r320742.

p_branch_empty was declared but never used due to an oversight. Use it as
designed, further comment on its return value.

MFC r320796:

    [7 lines not shown]

FreeBSD — head/sys/crypto ccp, head/sys/crypto/ccp ccp_hardware.c ccp.c

Add ccp(4): experimental driver for AMD Crypto Co-Processor

* Registers TRNG source for random(4)
* Finds available queues, LSBs; allocates static objects
* Allocates a shared MSI-X for all queues.  The hardware does not have
  separate interrupts per queue.  Working interrupt mode driver.
* Computes SHA hashes, HMAC.  Passes cryptotest.py, cryptocheck tests.
* Does AES-CBC, CTR mode, and XTS.  cryptotest.py and cryptocheck pass.
* Support for "authenc" (AES + HMAC).  (SHA1 seems to result in
  "unaligned" cleartext inputs from cryptocheck -- which the engine
  cannot handle.  SHA2 seems to work fine.)
* GCM passes for block-multiple AAD, input lengths

Largely based on ccr(4), part of cxgbe(4).

Rough performance averages on AMD Ryzen 1950X (4kB buffer):
aesni:      SHA1: ~8300 Mb/s    SHA256: ~8000 Mb/s
ccp:               ~630 Mb/s    SHA256:  ~660 Mb/s  SHA512:  ~700 Mb/s
cryptosoft:       ~1800 Mb/s    SHA256: ~1800 Mb/s  SHA512: ~2700 Mb/s

As you can see, performance is poor in comparison to aesni(4) and even
cryptosoft (due to high setup cost).  At a larger buffer size (128kB),
throughput is a little better (but still worse than aesni(4)):

aesni:      SHA1:~10400 Mb/s    SHA256: ~9950 Mb/s

    [15 lines not shown]

FreeBSD — stable/11/usr.bin/hexdump display.c

MFC r327567: hexdump(1): Speed up -s flag on devices

Using the -s flag on devices is extraordinarily slow due to using fseek(3) a
little too conservatively. Address this by using fseek on character/block
devices as well, falling back to getchar(3) only if we fail to seek or we're
operating on tape drives, where fseek may succeed while not actually being
supported.

PR:                86485
Delta File
+35 -11 stable/11/usr.bin/hexdump/display.c
+35 -11 1 file