DragonFlyBSD/src e4666ae — usr.bin/vi Makefile Makefile.inc, usr.bin/vi/catalog Makefile

vi: Use <bsd.dragonfly.mk> to help simplify the paths
DeltaFile
+8-10usr.bin/vi/catalog/Makefile
+2-1usr.bin/vi/vidump/Makefile
+3-0usr.bin/vi/Makefile.inc
+1-1usr.bin/vi/Makefile
+14-124 files

DragonFlyBSD/src 4ab6702 — games/fortune Makefile.inc, gnu/usr.bin/binutils227/block1 Makefile.block1

Minor cleanups to a few makefiles
DeltaFile
+4-7usr.bin/dsynth/Makefile
+1-3games/fortune/Makefile.inc
+1-2gnu/usr.bin/binutils234/block1/Makefile.block1
+1-2gnu/usr.bin/binutils227/block1/Makefile.block1
+7-144 files

DragonFlyBSD/src 587d557 — gnu/usr.bin/mpc Makefile, gnu/usr.bin/mpfr Makefile

Use <bsd.dragonfly.mk> to simplify some complex relative paths
DeltaFile
+8-6stand/lib/Makefile
+2-2lib/libpam/libpam/Makefile
+3-1stand/boot/dloader/Makefile
+3-1lib/libedit/Makefile.inc
+3-1gnu/usr.bin/mpfr/Makefile
+3-1gnu/usr.bin/mpc/Makefile
+22-123 files not shown
+31-159 files

DragonFlyBSD/src 8022d7c — lib/libc Makefile, lib/libc/gdtoa Makefile.inc

libc: Use <bsd.dragonfly.mk> to help simplify some paths
DeltaFile
+5-3lib/libc/Makefile
+2-3lib/libc/x86_64/sys/Makefile.inc
+2-2lib/libc/thread/Makefile.inc
+2-2lib/libc/gdtoa/Makefile.inc
+1-1lib/libc/tre-regex/Makefile.inc
+1-1lib/libc/sys/Makefile.inc
+13-121 files not shown
+14-137 files

DragonFlyBSD/src fad34d1 — gnu/lib/gcc120/libstdc++ Makefile.inc, lib/librecrypto Makefile.inc

Use <bsd.dragonfly.mk> to avoid extra path checking

These makefiles need to be included by makefiles in different
directories, so the extra path existence checks are required to handle
this.  Now just use <bsd.dragonfly.mk> to simplify this.
DeltaFile
+3-7lib/librecrypto/Makefile.inc
+1-8gnu/lib/gcc120/libstdc++/Makefile.inc
+3-2lib/libz/Makefile.stand
+7-173 files

DragonFlyBSD/src 102c72d — lib/libssh Makefile.common, usr.bin/ssh Makefile

ssh: Use <bsd.dragonfly.mk> to remove the LIBSSH_RELDIR hack
DeltaFile
+6-5lib/libssh/Makefile.common
+1-2usr.sbin/sshd/Makefile.etc
+1-2usr.sbin/sshd/Makefile
+1-2usr.bin/ssh/Makefile
+1-2usr.bin/ssh-keyscan/Makefile
+1-2usr.bin/ssh-keygen/Makefile
+11-1511 files not shown
+22-3717 files

DragonFlyBSD/src 0f1ef9a — gnu/usr.bin/binutils227/block1 Makefile.block1, gnu/usr.bin/binutils227/block2 Makefile.block2

binutils: Use <bsd.dragonfly.mk> to remove the RELTOP hack
DeltaFile
+4-9gnu/usr.bin/binutils234/block2/Makefile.block2
+4-9gnu/usr.bin/binutils227/block2/Makefile.block2
+3-8gnu/usr.bin/binutils234/block3/Makefile.gld
+3-8gnu/usr.bin/binutils227/block3/Makefile.gld
+2-7gnu/usr.bin/binutils234/block1/Makefile.block1
+2-7gnu/usr.bin/binutils227/block1/Makefile.block1
+18-486 files

DragonFlyBSD/src 0dc692e — gnu/lib/gcc80 Makefile.inc, gnu/usr.bin/cc80 Makefile.inc

cc80,gcc80: Use <bsd.dragonfly.mk> to remove RELUP/TOP_PREFIX hacks
DeltaFile
+12-11gnu/usr.bin/cc80/Makefile.inc
+7-6gnu/lib/gcc80/Makefile.inc
+1-2gnu/usr.bin/cc80/support-libs/Makefile.inc
+1-2gnu/usr.bin/cc80/drivers/Makefile.inc
+1-2gnu/usr.bin/cc80/cc_tools/Makefile.inc
+0-2gnu/usr.bin/cc80/backends/programs/lto1/Makefile
+22-2513 files not shown
+22-4619 files

DragonFlyBSD/src 3f4028c — gnu/lib/gcc120 Makefile.inc, gnu/usr.bin/cc120 Makefile.inc

cc120,gcc120: Use <bsd.dragonfly.mk> to remove RELUP/TOP_PREFIX hacks

In addition, fix the "tm.h" generation in gnu/lib/csu/Makefile.csu; it
was called from .OBJDIR so the DF.SRCTOP would fail in that case.
DeltaFile
+12-11gnu/usr.bin/cc120/Makefile.inc
+7-6gnu/lib/gcc120/Makefile.inc
+1-2gnu/usr.bin/cc120/support-libs/Makefile.inc
+1-2gnu/usr.bin/cc120/drivers/Makefile.inc
+1-2gnu/usr.bin/cc120/cc_tools/Makefile.inc
+0-2gnu/usr.bin/cc120/backends/programs/lto1/Makefile
+22-2517 files not shown
+23-5123 files

DragonFlyBSD/src 517e6a0 — share/mk Makefile bsd.README

share/mk: Add bsd.dragonfly.mk to provide source tree path variables

The include file provides the DF.SRCTOP, DF.RELDIR, DF.RELTOP and
DF.OBJTOP variables to help access the source and object trees, and thus
help avoid the complex and fragile relative paths that depend on the
location of the including makefiles.

In particular, DF.SRCTOP and DF.OBJTOP defines the absolute paths to the
source and object trees, so makefiles using these variables can be
included by any other makefiles, without hacking a variable to fix the
relative-path-based addressing. For example, gnu/usr.bin/cc120 hacks
this need with the "TOP_PREFIX" variable.

This idea is inspired by FreeBSD's SRCTOP, which is defined in
<src.sys.env.mk> and is finally included by <sys.mk>, so it becomes an
early global and can be directly used by any makefiles.  We decided to
not touch <sys.mk> but place it in a separate include file (i.e.,
<bsd.dragonfly.mk>), so any makefiles that really want these variables
must explicitly include it.  By the way, NetBSD also defines the

    [3 lines not shown]
DeltaFile
+47-0share/mk/bsd.dragonfly.mk
+20-0share/mk/bsd.README
+1-0share/mk/Makefile
+68-03 files

DragonFlyBSD/src 9d07571 — share/mk Makefile

share/mk: Sort files in Makefile
DeltaFile
+20-7share/mk/Makefile
+20-71 files

DragonFlyBSD/src 4a7aa99 — sys/kern kern_sig.c

kernel: report the sender in sigwaitinfo() and sigtimedwait()

kern_sigtimedwait() returned only si_signo.  lwpsignal() records the
sender's pid and uid in ps_frominfo[] for every signal it posts, and
sendsig() copies them into the siginfo of an SA_SIGINFO handler, but a
signal taken with sigwaitinfo() or sigtimedwait() came back with si_pid
and si_uid 0.

Bug: https://bugs.dragonflybsd.org/issues/3471
Reviewed-by: @dillon
DeltaFile
+2-0sys/kern/kern_sig.c
+2-01 files

DragonFlyBSD/src 7ee46dd — sbin/mount_fuse mount_fusefs.c

mount_fusefs(8): accept and ignore the "nempty" option

ntfs-3g mounts with "nonempty" by default and libfuse passes it to
mount_fusefs.  getmntopts() treats the leading "no" as negation and
looks up "nempty", which is not in the option table, so the mount fails
with "-o nempty: option not supported".  Add the ignore entry that
FreeBSD's mount_fusefs(8) has.

Bug: https://bugs.dragonflybsd.org/issues/3459
DeltaFile
+3-1sbin/mount_fuse/mount_fusefs.c
+3-11 files

DragonFlyBSD/src 053116c — sys/vfs/fuse fuse_vnops.c

fuse: fix a lost wakeup in the I/O helper

fuse_io_thread() slept first and drained the queue only after waking.
After draining it released helper_spin and called tsleep()
unconditionally.  fuse_vop_strategy() queues a bio under helper_spin,
drops the lock and then calls wakeup(), so a wakeup that arrived
between that final spin_unlock() and the interlock taken inside
tsleep() was lost.  The helper then slept forever with the bio queued
and the caller hung in biowait().

Hold helper_spin while checking the queue and use ssleep(), which
takes the sleep-queue interlock and drops the spinlock in one step,
so the wakeup cannot be lost.

Bug: https://bugs.dragonflybsd.org/issues/3459
DeltaFile
+4-1sys/vfs/fuse/fuse_vnops.c
+4-11 files

DragonFlyBSD/src 222a25d — sys/vfs/fuse fuse_vnops.c

fuse: honor an explicit ftruncate() size

An earlier write extension sets fnp->sizeoverride, which made
fuse_set_attr() keep the old size and ignore an explicit
ftruncate().  Clear the override for FATTR_SIZE setattrs.

Bug: https://bugs.dragonflybsd.org/issues/3459
DeltaFile
+2-0sys/vfs/fuse/fuse_vnops.c
+2-01 files

DragonFlyBSD/src 5174c27 — sys/vfs/fuse fuse_vnops.c

fuse: zero-fill the tail of a short read

A short FUSE_READ reply copied only the returned bytes into the 4 KiB
BIO buffer, leaving the rest stale, so an mmap read of an unwritten
hole returned old data.  Clamp the copy to b_bcount and zero the
remainder.

Bug: https://bugs.dragonflybsd.org/issues/3459
DeltaFile
+10-2sys/vfs/fuse/fuse_vnops.c
+10-21 files

DragonFlyBSD/src 84e673f — sys/vfs/fuse fuse.h fuse_vnops.c

fuse: treat a zero file handle as a valid handle

ntfs-3g returns file handle 0 for regular files.  The driver used
fh == 0 as its "no handle" state, so it reopened the file on every
open and skipped FUSE_RELEASE and FUSE_FSYNC.  The userspace daemon
then still considered the file open and renamed unlinked files to
.fuse_hidden*.

Add an explicit fh_valid flag to struct fuse_node and use it instead
of the fh value.

Bug: https://bugs.dragonflybsd.org/issues/3459
DeltaFile
+6-4sys/vfs/fuse/fuse_vnops.c
+1-0sys/vfs/fuse/fuse.h
+7-42 files

DragonFlyBSD/src caceac6 — sys/bus/u4b usb_busdma.c

u4b: Do not assume page-aligned busdma segments in the DMA page table

usb_pc_common_mem_cb() walked the busdma segment list assuming every
segment after the first begins on a page boundary (rem reset to 0 and
the next entry always taken from the new segment's base address).
busdma splits segments at physical page boundaries, at physical
discontinuities and at maxsegsz; the first two begin a new segment on
a page boundary, but when a buffer starts mid-page and consecutive
pages are physically adjacent, the maxsegsz split ends a segment in
the middle of a page and its continuation begins mid-page.  When that
happened, the walk recorded the continuation's frame a second time
under the next page index, shifting every later entry by one page.

usbd_get_page() then handed the host controller wrong bus addresses
for all pages after the duplicated entry, so multi-page USB storage
reads returned the content of the following page and left the tail of
the transfer with unrelated memory.  This needs a buffer whose first
byte is not page aligned together with such a mid-page split, which is
why 1 KiB and 2 KiB block filesystems on USB storage were affected

    [17 lines not shown]
DeltaFile
+21-12sys/bus/u4b/usb_busdma.c
+21-121 files

DragonFlyBSD/src 64ff743 — sys/kern kern_environment.c

kernel: Skip oversized loader environment entries

kenv_init() copies every loader environment string into the dynamic
kenv without a length limit, and kgetenv() later copies the value
into a 258-byte stack buffer with strcpy().  A long value overflows
the buffer when it is read, for example by an unprivileged kenv(1)
call, and causes a fatal trap.

Skip entries longer than KENV_MNAMELEN + KENV_MVALLEN + 2 bytes and
print a warning, like FreeBSD's init_dynamic_kenv() does.  An entry
(name, '=' and value) of up to 257 characters keeps working.

Bug: https://bugs.dragonflybsd.org/issues/3466
DeltaFile
+6-0sys/kern/kern_environment.c
+6-01 files

DragonFlyBSD/src f1b9cbd — gnu/usr.bin/cc120 Makefile.langs

cc120: Include all tree codes in all-tree.def to fix LTO compatibility

Before this fix, the base GCC 12 and the lang/gcc12 package couldn't
link each other's LTO objects. This was caused by the enumeration
mismatch of LTO tags, because the two compilers had different
all-tree.def: the base GCC 12 removed ada-tree.def, d-tree.def and
objc-tree.def because those languages are disabled.

Fix this LTO compatibility issue by adding back the removed tree codes,
and thus generate the same all-tree.def as the GCC's own configure does.

Bug: https://bugs.dragonflybsd.org/issues/3470
DeltaFile
+7-1gnu/usr.bin/cc120/Makefile.langs
+7-11 files

DragonFlyBSD/src d486d43 — contrib/gcc-12 README.DELETED

contrib/gcc-12: Update README.DELETED
DeltaFile
+612-3contrib/gcc-12/README.DELETED
+612-31 files

DragonFlyBSD/src 353ed18 — contrib/gcc-12/gcc/ada/gcc-interface ada-tree.def, contrib/gcc-12/gcc/d d-tree.def

Merge branch 'vendor/GCC120'
DeltaFile
+79-0contrib/gcc-12/gcc/ada/gcc-interface/ada-tree.def
+76-0contrib/gcc-12/gcc/objc/objc-tree.def
+29-0contrib/gcc-12/gcc/d/d-tree.def
+184-03 files

DragonFlyBSD/src 45d2e78 — sys/dev/virtual/nvmm/x86 nvmm_x86_vmx.c nvmm_x86_svm.c

nvmm: Introduce a dynamic xcr0_valid

Similar to the existing dynamical cr4_valid and efer_valid.

Obtained-from: NVMM Reference Implementation
DeltaFile
+17-14sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+17-14sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+34-282 files

DragonFlyBSD/src dcdce33 — sys/dev/virtual/nvmm/x86 nvmm_x86.c

nvmm: Don't advertise FMA4/XOP as the required AVX is not exposed

Obtained-from: NVMM Reference Implementation
DeltaFile
+2-2sys/dev/virtual/nvmm/x86/nvmm_x86.c
+2-21 files

DragonFlyBSD/src 280a73f — sys/dev/virtual/nvmm/x86 nvmm_x86_vmx.c nvmm_x86_svm.c

nvmm: Improve CPUID handling

- If the emulator wants to exit on a leaf, don't overwrite the
  registers.
- On AMD, out-of-range leaves return zero, not the highest supported
  leaf, so return zero.

Obtained-from: NVMM Reference Implementation
DeltaFile
+49-34sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+41-35sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+90-692 files

DragonFlyBSD/src 02283a7 — lib/libnvmm libnvmm.3, sys/dev/virtual/nvmm/x86 nvmm_x86_vmx.c nvmm_x86_svm.c

nvmm: Change the meaning of TPR_CHANGED

Currently we return TPR_CHANGED if the guest changes its TPR. But the only
change the emulator is interested in is if the TPR is lowered, as that
unblocks certain classes of interrupts; the emulator doesn't care if the
TPR is increased.

Change the behavior to return TPR_CHANGED only if the TPR is lowered.
Then, implement an optimization on SVM: instead of intercepting all
writes to CR8 and returning to userland, use a TPR trap to get VMEXITs
only when the guest lowers its TPR.

This effectively eliminates VMEXITs on TPR increases, which significantly
improves the performance of Windows guests (because they frequently
increase and decrease the TPR).

Update the libnvmm.3 man page and the test cases as well.

Obtained-from: NVMM Reference Implementation
DeltaFile
+44-52sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+5-4sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+3-3test/testcases/libnvmm/h_misc.c
+2-2lib/libnvmm/libnvmm.3
+1-0test/testcases/libnvmm/h_os.h
+55-615 files

DragonFlyBSD/src 08f50a6 — lib/libnvmm libnvmm_x86.c

libnvmm: Fix -Winline warnings (2)

Rework the fix by by removing the `inline` keyword on `x86_gva_to_gpa()`,
because it has grown much bigger than the initial version.

Obtained-from: NVMM Reference Implementation
DeltaFile
+4-6lib/libnvmm/libnvmm_x86.c
+4-61 files

DragonFlyBSD/src 9e1d3d6 — sys/dev/virtual/nvmm/x86 nvmm_x86_vmx.c nvmm_x86_svm.c

nvmm: Improve XSETBV handling

XSETBV uses ECX, not RCX.

Obtained-from: NVMM Reference Implementation
DeltaFile
+3-1sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+3-1sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+6-22 files

DragonFlyBSD/src b20d49e — sys/dev/virtual/nvmm/x86 nvmm_x86_vmx.c

nvmm: Use dynamic cr4_valid/efer_valid values in VMX

Implement the same feature like SVM.  Also filter out EFER in setstate().

Obtained-from: NVMM Reference Implementation
DeltaFile
+49-31sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+49-311 files

DragonFlyBSD/src 22d5c0b — sys/dev/virtual/nvmm/x86 nvmm_x86_vmx.c

nvmm: Fix the handling of CR0.NE in VMX

CR0.NE must be forced to 1, so add it to CR0_STATIC_MASK. Otherwise
a #GP can be raised in the guest.

Bug: https://bugs.dragonflybsd.org/issues/3452
DeltaFile
+4-4sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+4-41 files