HardenedBSD/src 2d1fc19 — sys/dev/mlx5/mlx5_en mlx5_en_main.c en.h

mlx5en: fix RX HW timestamp overflow with 1GHz clock

mlx5e_mbuf_tstmp() splits the HW clock delta into seconds and a
sub-second remainder before scaling it by the calibration interval.
With a 1GHz core clock and the default 30 seconds recalibration
interval, both the remainder multiplied by the interval in ns and the
carry over multiplied by cclk exceed 2^64.  RX timestamps end up off by
up to two seconds, which shows up as clock drift in NTP using HW RX
timestamps.

Take the whole calibration intervals out of the HW clock delta first,
so that the rest of the computation does not depend on how far the
timestamp is from the calibration point, e.g. after the system was
suspended.  Then split the rest at 2^20 clocks, about 1ms at 1GHz,
instead of at seconds, using shifts and masks.  The split no longer
depends on the clock frequency, so priv->cclk is removed.

Reviewed by:    kib, gallatin
Sponsored by:   Nvidia networking

    [2 lines not shown]
DeltaFile
+37-29sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
+0-2sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+1-1sys/dev/mlx5/mlx5_en/en.h
+38-323 files

HardenedBSD/src cada535 — sys/kern imgact_elf.c

imgact_elf: accept PT_INTERP segments up to 4096 bytes

The Yocto/Poky relocatable SDK NUL-pads the interpreter path in
PT_INTERP out to 4096 bytes (within Linux's POSIX PATH_MAX) so that
'relocate_sdk.py' can rewrite the path in place.  The kernel rejected
any PT_INTERP with p_filesz > BSD's MAXPATHLEN (1024) with
"Invalid PT_INTERP" and ENOEXEC, so none of the SDK's binaries could
be run under the Linuxulator.

- The PT_INTERP segment may now be up to 'PT_INTERP_SEG_MAXSZ'
  bytes, which may be greater than 'MAXPATHLEN'.
- The interpreter path within the segment must still be shorter
  than 'MAXPATHLEN' -- when violated results in 'ENAMETOOLONG'
  when the interpreter is looked up.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D62075
(cherry picked from commit 7ee8d41ebb2ffb13e50ea59fd5bc43155123f323)
DeltaFile
+10-2sys/kern/imgact_elf.c
+10-21 files

HardenedBSD/src 79d5c5b — sys/powerpc/linux linux_locore.asm linux_sysvec.c

linuxulator/powerpc: report the CPU family in AT_PLATFORM

Linux passes the CPU family here, e.g. power9. glibc uses it for
__builtin_cpu_is().

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D62279
DeltaFile
+31-0sys/powerpc/linux/linux_sysvec.c
+2-5sys/powerpc/linux/linux_locore.asm
+33-52 files

HardenedBSD/src 7f74e2d — sys/modules/linux64 Makefile, sys/powerpc/linux linux_support.S linux_machdep.c

linuxulator/powerpc: implement the FUTEX_WAKE_OP helpers

These were stubs returning ENOTSUP. Qt uses FUTEX_WAKE_OP, so Qt programs
hung as soon as they started a thread.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D62278
DeltaFile
+84-0sys/powerpc/linux/linux_machdep.c
+0-70sys/powerpc/linux/linux_support.S
+3-1sys/modules/linux64/Makefile
+87-713 files

HardenedBSD/src 2cf4a4d — sys/compat/linux linux_ioctl.c linux_ioctl.h, sys/powerpc/linux linux_termbits.h linux_machdep.c

linuxulator/powerpc: fix terminal ioctls

linux_ioctl() only looks at the low 16 bits of the command, so the PowerPC
handler was never called and isatty() failed. Return ENOIOCTL for commands
we don't know, so that other handlers get a chance.

struct termios has c_cc before c_line and carries the speeds on PowerPC,
and CSIZE is encoded like on BSD. Fix the codes for 57600 and 115200 baud
while here.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D62277
DeltaFile
+17-0sys/compat/linux/linux_ioctl.h
+3-5sys/powerpc/linux/linux_machdep.c
+6-2sys/powerpc/linux/linux.h
+6-2sys/compat/linux/linux_ioctl.c
+2-2sys/powerpc/linux/linux_termbits.h
+34-115 files

HardenedBSD/src 08e7d27 — sys/dev/usb usbdevs, sys/dev/usb/quirk usb_quirk.c

Add USB quirk for WCH-Link adapter

WCH-Link is a debug adapter from QinHeng Electronics that features a
(proprietary) debug bridge for their RISC-V MCUs, as well as a serial
gateway, implemented as a CDC device.  The CDC's call management
descriptor declares the data interface to be 1, but it is actually
interface 2. UQ_IGNORE_CDC_CM has already been implemented before to
handle this kind of firmware bug, so just add this quirk for WCH-Link.

Reported by:    Holm Tiffe

(cherry picked from commit 1660d69068a0650fcda2ce7497dfa20e33f0b58d)
DeltaFile
+1-0sys/dev/usb/usbdevs
+1-0sys/dev/usb/quirk/usb_quirk.c
+2-02 files

HardenedBSD/src 5cc3934 — sys/powerpc/linux linux.h

linuxulator/powerpc: use the PowerPC socket option numbers

Six socket options are numbered differently on PowerPC. linux_socket.h
already has an #ifndef for that, but nothing defined them.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D62276
DeltaFile
+11-0sys/powerpc/linux/linux.h
+11-01 files

HardenedBSD/src 380912c — sys/compat/linux linux_socket.c linux_socket.h, sys/powerpc/linux linux_syscalls.c linux_proto.h

linuxulator/powerpc: enable socketcall

PowerPC had no separate socket syscalls before Linux 4.3, so binaries
built for older kernels use socketcall() for everything.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D62275
DeltaFile
+26-0sys/powerpc/linux/linux_systrace_args.c
+6-1sys/powerpc/linux/syscalls.master
+5-1sys/compat/linux/linux_socket.h
+6-0sys/powerpc/linux/linux_proto.h
+3-1sys/compat/linux/linux_socket.c
+1-1sys/powerpc/linux/linux_syscalls.c
+47-42 files not shown
+49-58 files

HardenedBSD/src 0c84e0f — sys/powerpc/linux linux_sysent.c linux_syscalls.c

linuxulator/powerpc: implement send, recv and ipc

glibc uses send(), recv() and the ipc() multiplexer on PowerPC. Without
them DNS lookups and SysV shared memory don't work.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D62274
DeltaFile
+173-0sys/powerpc/linux/linux_machdep.c
+110-0sys/powerpc/linux/linux_systrace_args.c
+26-3sys/powerpc/linux/syscalls.master
+26-0sys/powerpc/linux/linux_proto.h
+3-3sys/powerpc/linux/linux_sysent.c
+3-3sys/powerpc/linux/linux_syscalls.c
+341-91 files not shown
+344-97 files

HardenedBSD/src d6fd892 — sys/amd64/acpica acpi_machdep.c, sys/arm64/acpica acpi_machdep.c

acpi: acpivar.h: Include ACPICA's acpi.h, remove the latter in consumers

<dev/acpica/acpivar.h> uses types from
<contrib/dev/acpica/include/acpi.h>, so have it include it directly.

This allows removing that include, and in passing some superfluous
includes from sys/contrib/dev/acpica/include, from all source files
including <dev/acpica/acpivar.h>.

Reviewed by:    imp, jaeyoon
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D62103
DeltaFile
+7-2sys/dev/acpica/acpivar.h
+2-4sys/dev/acpica/acpi.c
+0-5sys/dev/acpica/acpi_apei.c
+1-4sys/dev/pci/pci_host_generic_acpi.c
+1-4sys/arm64/acpica/acpi_machdep.c
+1-4sys/amd64/acpica/acpi_machdep.c
+12-23156 files not shown
+14-352162 files

HardenedBSD/src fa29f0c — sys/powerpc/linux linux_machdep.c linux_sysent.c

linuxulator/powerpc: move syscalls out of the 32-bit only slots

On powerpc64 select() is syscall 142, getrlimit() is 190 and umount2() is
52. We had them at 82, 76 and 22, which are 32-bit only. Linux programs
couldn't unmount anything.

mmap2 is 32-bit only as well. Use linux_mmap2() for mmap like amd64 and
arm64 do and remove our copy of it.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D62273
DeltaFile
+80-122sys/powerpc/linux/linux_systrace_args.c
+25-34sys/powerpc/linux/syscalls.master
+23-33sys/powerpc/linux/linux_proto.h
+8-8sys/powerpc/linux/linux_sysent.c
+8-8sys/powerpc/linux/linux_syscalls.c
+0-10sys/powerpc/linux/linux_machdep.c
+144-2151 files not shown
+148-2207 files

HardenedBSD/src 365638b — libexec/rtld-elf/powerpc64 rtld_machdep.h reloc.c

rtld: preserve the FP and vector registers in __tls_get_addr() on powerpc64

LLVM assumes that __tls_get_addr() clobbers only r0, r4-r12, LR, CTR,
CR0, CR1 and CR5-CR7 (the GETtlsADDR pseudo in PPCInstr64Bit.td), as
glibc's implementation guarantees, and keeps live values in the other
registers across the call.  Our slow path, which runs on the first
access to the TLS block of a dlopen()ed object, copies the TLS
initialization image with the generic memcpy() and memset(), which
clang vectorizes: for a 130-byte block they clobber vs0, vs1, v0, v2,
v3 and v5 on powerpc64le and v2, v4 and v5 in a POWER9 powerpc64 build.

Qt's QBindingStorage constructor zeroes vs0, calls __tls_get_addr() and
then stores vs0 into the object, so the first QObject created by a
process that dlopen()ed libQt6Core gets 0xffffffff in its binding
storage pointer and crashes on destruction; this is why devel/pyside6
cannot generate QtGui.pyi on powerpc64le.

Keep the fast path as it is and run the slow path through a trampoline
that saves and restores the volatile floating-point and vector

    [13 lines not shown]
DeltaFile
+72-0libexec/rtld-elf/powerpc64/rtld_start.S
+31-2libexec/rtld-elf/powerpc64/reloc.c
+7-0libexec/rtld-elf/powerpc64/rtld_machdep.h
+110-23 files

HardenedBSD/src 9bf3482 — stand/efi/loader main.c, stand/libsa stand.h features.c

stand: Support jumping to UEFI setup

Add support to reboot to UEFI setup. This basically add indication to
OsIndications then reboot. OsIndicationsSupported is checked before
making any decision.

Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D61996
DeltaFile
+64-0stand/efi/loader/main.c
+25-1stand/man/loader.efi.8
+19-0stand/lua/menu.lua
+1-0stand/libsa/stand.h
+1-0stand/libsa/features.c
+110-15 files

HardenedBSD/src 652a8a7 — release Makefile.vm

EC2: Use stream-optimized VMDK format

Once enabled on all of the branches, this will reduce bandwidth
consumption from uploading weekly snapshot builds from ~500 GB to
~100 GB, as well as significantly speeding up the process.

MFC after:      2 months
Sponsored by:   Amazon

(cherry picked from commit 34f2f57b836d9cec02130419f5272495860d4ddf)
DeltaFile
+1-1release/Makefile.vm
+1-11 files

HardenedBSD/src 47f4884 — sys/netipsec ipsec.c udpencap.c

netipsec: Do not zero the IPv6 UDP checksum after NAT-T decapsulation

When transport mode ESP arrives in UDP and the IKE daemon gave no
original addresses (NAT-OA) for the SA, the default
net.inet.ipsec.natt_cksum_policy has udp_ipsec_adjust_cksum() ignore the
checksum of the inner header: a TCP segment is marked as verified and
the checksum of a UDP datagram is set to zero.  This is option c of RFC
3948, section 3.1.2, which was written with IPv4 in mind.  UDP over IPv6
has no "no checksum" value, so udp6_input() dropped every such datagram.
With strongSwan, which installs no NAT-OA for these SAs, TCP and ICMPv6
worked over an IPv6 transport mode SA with UDP encapsulation and UDP
did not.

Mark the datagram as verified instead, as is done for TCP.  Linux does
the same for both address families.  A datagram that the sender gave a
zero checksum is still dropped.

Fixes:          80044c785cb0 ("Add UDP encapsulation of ESP in IPv6")
MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+9-4sys/netipsec/udpencap.c
+3-2sys/netipsec/ipsec.c
+12-62 files

HardenedBSD/src 3847674 — sys/powerpc/powerpc trap.c

powerpc: Avoid panicking on alignment errors

PowerPC ISA specifies that an alignment fault can occur when any load or
store accesses cache-inhibited or write-through memory.  Since
copyin/copyout don't know what type of memory they will access we can't
always trust that memory is well behaved, or that it's properly aligned.
Avoid a panic by giving the fault handler a chance to deal with it and
propagate the fault back up.
DeltaFile
+1-0sys/powerpc/powerpc/trap.c
+1-01 files

HardenedBSD/src 63bb824 — lib/libkvm kvm_private.c

libkvm: Add basic sanity check in _kvm_pt_init

_kvm_pt_init() assumes that the map length passed in is an even multiple
of 8 bytes, and the loop over the map decrements by 8
(sizeof(uint64_t)).  Since `res` is unsigned, if the result is not a
multiple of 8 then it wraps where it would otherwise stop, thereby
writing memory until a crash.  Address this by just erroring out on
invalid input, since valid cores will never have a short size.

Reviewed by:    kib
Sponsored by:   Hewlett Packard Enterprise Development LP
Differential Revision:  https://reviews.freebsd.org/D62333
DeltaFile
+5-0lib/libkvm/kvm_private.c
+5-01 files

HardenedBSD/src 3cd5e9e — sys/netinet ip_fastfwd.c, tests/sys/netpfil/ipfw fwd.sh

netinet: Send to the next hop a pfil hook chose in ip_tryforward()

When an inbound pfil hook chooses the next hop (ipfw fwd),
ip_tryforward() looks up the route to it and keeps the address in dest,
which if_output() gets as the next hop when the route has no gateway.
After the outbound hooks dest is set back to the destination of the
packet.  ipfw always installs an outbound hook, so a packet forwarded
to a next hop on a connected network leaves on the right interface but
for the wrong neighbour: the router tries to resolve the destination
of the packet there ("arpresolve: can't allocate llinfo") and the
packet is lost.  This worked until 9ac7c6cfed72, before which the
address came from the route lookup.

Set dest from the packet only when the outbound hooks changed the
destination or chose a next hop.  To tell, compare with the destination
as it was before these hooks, as ip6_tryforward() does.  The comparison
with the destination before the inbound hooks, which is older than
9ac7c6cfed72, also lost the next hop of a packet whose destination an
inbound hook had rewritten, and for such a packet it repeated the check

    [14 lines not shown]
DeltaFile
+111-0tests/sys/netpfil/ipfw/fwd.sh
+5-3sys/netinet/ip_fastfwd.c
+116-32 files

HardenedBSD/src 36c74bd — sys/netipsec udpencap.c

netipsec: Allow IPv6 extension headers before UDP encapsulated ESP

udp_ipsec_input() took the UDP header of an IPv6 packet to follow the
IPv6 header directly.  With a hop-by-hop, routing or destination options
header in front of it, the SA was still found by its SPI, but the port
check then read the extension header instead of the UDP header, and the
packet was dropped as having no SA.  The ESP protocol number was also
written to the next header field of the IPv6 header, not to the one that
led to the UDP header.

Derive the offset of the UDP header from the payload offset that
udp6_append() passes, and find the next header field with
ip6_get_prevhdr(), as ipsec6_input() does since 3d810fa261f1.

udp_ipsec_adjust_cksum() made the same assumption where it recomputes
the checksum of the inner TCP or UDP header
(net.inet.ipsec.natt_cksum_policy set to 1): it summed from the end of
the IPv6 header and stored the result at that offset, inside the
extension header.  Use the offset of the transport header that the

    [6 lines not shown]
DeltaFile
+5-6sys/netipsec/udpencap.c
+5-61 files

HardenedBSD/src 71c7235 — lib/libc/stdio vfwscanf.c, lib/libc/tests/stdio swscanf_test.c sscanf_test.c

stdio: Fix negated wchar scansets

We were recording the start of the scanset before checking if it began
with a caret.  We need to check for a caret first, then record whatever
comes next as the start of the scanset.

Note that scanf() did not have this bug, only wscanf(), but this adds
regression tests for both anyway.

MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D62328
DeltaFile
+3-2lib/libc/stdio/vfwscanf.c
+5-0lib/libc/tests/stdio/swscanf_test.c
+5-0lib/libc/tests/stdio/sscanf_test.c
+13-23 files

HardenedBSD/src ae6b73d — release/tools ec2-desktop.conf

EC2: Explicitly block root login via RDP

MFC after:      0 days
Security:       GHSA-3rww-h298-82rx
Sponsored by:   Amazon

(cherry picked from commit 2112d90be7a855d4c9f598409850d54583089de2)
DeltaFile
+3-0release/tools/ec2-desktop.conf
+3-01 files

HardenedBSD/src 2112d90 — release/tools ec2-desktop.conf

EC2: Explicitly block root login via RDP

MFC after:      0 days
Security:       GHSA-3rww-h298-82rx
Sponsored by:   Amazon
DeltaFile
+3-0release/tools/ec2-desktop.conf
+3-01 files

HardenedBSD/src 3a1bfc3 — sys/netipsec ipsec_input.c

netipsec: Requeue a nested IPsec header on IPv6 input

In transport mode ipsec6_common_input_cb() delivers the packet itself,
on the stack of the crypto callback that called it.  With a synchronous
crypto driver that is the stack of the thread that dispatched the
request.  Since 3cd5f1b307ad the callback hands a further AH, ESP or
IPComp header to ipsec_common_input() from there, so the transform, its
callback and the next delivery all ran below the first one.  Every
nested header added a set of frames and only the size of the packet
limited their number.  IPComp carries no authentication and
ipcomp_input() only refuses an IPComp header that is directly followed
by another, so anyone who could reach a host with an IPv6 IPComp SA
could overflow the kernel stack with one packet that hides each IPComp
header behind a destination options header.

Requeue the packet to the IPv6 netisr instead, as the IPv4 callback
does for every transport mode packet, and let ip6_input() hand the
header over from a fresh stack.  ip6_input() refuses addresses in the
embedded scope form that its first pass left behind, so put them back

    [19 lines not shown]
DeltaFile
+22-5sys/netipsec/ipsec_input.c
+22-51 files

HardenedBSD/src 496b57c — lib/libthr/thread thr_spinlock.c

libthr: fix libc spinlock initialization

Publish thr_extra with a release store only after _thr_umutex_init()
and read it with an acquire load, so that a thread racing the first use
of a libc spinlock cannot lock the umutex before it is initialized.

PR:     301407
Fixes:  bddd24cd9c3e ("Replace internal usage of struct umtx with umutex which can ...")
Reviewed by:    kib
MFC after:      1 week
DeltaFile
+23-10lib/libthr/thread/thr_spinlock.c
+23-101 files

HardenedBSD/src f6e3d4d — sys/fs/nfs nfsport.h, sys/fs/nfsclient nfs_clport.c nfs_clnode.c

nfscl: Set up a custom buf_ops so that VOP_STRATEGY() call is avoided

A crash was reported, where there was a panic because
a NFS client bwrite() call resulted in a call to VOP_STRATEGY()
where the vp is unlocked.

I believe that write-backs done via the NFS client are safe to
do while holding the buffer lock, but not the vnode lock.

To avoid this panic, this patch defines a custom buf_ops
with an NFS specific bufstrategy() function that calls the
NFS strategy code directly instead of through a VOP_STRATEGY()
call.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D62336
DeltaFile
+24-7sys/fs/nfsclient/nfs_clvnops.c
+3-5sys/fs/nfs/nfsport.h
+1-1sys/fs/nfsclient/nfs_clport.c
+1-1sys/fs/nfsclient/nfs_clnode.c
+29-144 files

HardenedBSD/src 8658253 — sys/fs/nfsserver nfs_nfsdstate.c

nfs_nfsdstate.c: Partial revert of 64857418bb23

Dropping the cached reply that is too large causes
a correctness problem that is too difficult to fix,
so revert this and leave it the way it was.

Although there is an argument that not doing could
cause resource exhaustion, it has not been reported
in the field as a problem.

(cherry picked from commit bc7366a340edb366c37352c636b8360de92aa3a2)
DeltaFile
+0-4sys/fs/nfsserver/nfs_nfsdstate.c
+0-41 files

HardenedBSD/src 4f5e70e — sys/fs/nfsserver nfs_nfsdstate.c nfs_nfsdserv.c

nfsd: Fix handling of RPC messages too large to cache

The NFSv4.1/4.2 session negotiates a limit to the size
of an RPC reply message that can be cached for the session
slot.

This patch fixes the code so that it checks that limit and
does not cache replies larger than the limit, even if the
client requested that it be cached.

This patch is slightly different than what the author
submitted, but retains the check for reply cache size limit.

(cherry picked from commit 64857418bb2379a7d89b6af04cddf92fa48dd28c)
DeltaFile
+6-0sys/fs/nfsserver/nfs_nfsdserv.c
+4-0sys/fs/nfsserver/nfs_nfsdstate.c
+10-02 files

HardenedBSD/src 4b3c3e9 — sys/ofed/drivers/infiniband/ulp/nfsclrdma xprt_verbs.c

xprt_verbs.c: Use the default fib# for route lookups

Without this patch, fib4_lookup()/fib6_lookup() are
called with the fib# for the current thread.
During a reconnect, this could be any thread, so use
the default fib# instead.

Reported by:    llm-postcr
MFC after:      1 month
Fixes:  80bee4d83637 ("nfsclrdma: Add code to support client side NFS over RDMA")
DeltaFile
+2-4sys/ofed/drivers/infiniband/ulp/nfsclrdma/xprt_verbs.c
+2-41 files

HardenedBSD/src cefc83b — sys/netinet6 ip6_input.c, tests/sys/netipsec/tunnel Makefile utils.subr

netinet6: Keep the AH flags on the inner packet of a tunnel mode SA

ip6_input() clears M_AUTHIPHDR and M_AUTHIPDGM on every packet. The
inner packet of a tunnel mode AH SA reaches it through netisr after
ipsec[46]_common_input_cb() has stripped the outer header, so it loses
the flags that ah_input_cb() set after verifying the ICV. The inbound
policy check in ipsec_in_reject() then finds no AH flag on a packet
whose policy requires AH and drops it as a policy violation ("inbound
packets violated process security policy" in netstat -sp ipsec6). With
the usual "require" level, every IPv6 packet carried by a policy-based
AH tunnel is dropped, whatever the outer address family. ESP is not
affected, since M_DECRYPTED is not cleared, and neither are IPv4 inner
packets, since ip_input() has never cleared the flags. if_ipsec(4) is
not involved, since it only uses ESP.

net.inet.ipsec.check_policy_history does not help: ipsec_in_reject()
checks the flags in addition to the history tags.

The clearing comes from KAME, whose ah6_input() deliberately did not

    [24 lines not shown]
DeltaFile
+42-0tests/sys/netipsec/tunnel/ah_hmac_sha2_256.sh
+14-8tests/sys/netipsec/tunnel/utils.subr
+0-12sys/netinet6/ip6_input.c
+1-0tests/sys/netipsec/tunnel/Makefile
+57-204 files

HardenedBSD/src 0397c1a — sys/powerpc/powerpc elf64_machdep.c elf32_machdep.c

powerpc: keep the vector registers in a core after setcontext

After setcontext() or sigreturn the AltiVec and VSX registers stay in
the PCB until the thread touches them again, and only PCB_VECREGS and
PCB_FPREGS say they're valid. The NT_PPC_VMX and NT_PPC_VSX core notes
are only written when PCB_VEC and PCB_VSX are set, so a core dumped in
that window has no vector registers for the thread. Check the validity
flags instead, like get_mcontext() does.

PCB_FPREGS is also set on CPUs without VSX, so only write the VSX note
when the CPU has it.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D62315
DeltaFile
+3-2sys/powerpc/powerpc/elf64_machdep.c
+3-2sys/powerpc/powerpc/elf32_machdep.c
+6-42 files