DragonFlyBSD/src 832c4d8 — lib/libc/stdlib hcreate.c hcreate.3

hcreate(3): Stop freeing key values

POSIX leaves ownership of ENTRY.key with the caller. NetBSD and FreeBSD
both stopped freeing key values in July 2014, and OpenBSD made the
change in August 2026.

Update the function description in the man page according to OpenBSD's;
adjust the example in the man page according to the POSIX spec.

OpenBSD: https://github.com/openbsd/src/commit/99858244924d27f541bdf37cb5565ee9525d7753
POSIX: https://pubs.opengroup.org/onlinepubs/9799919799/functions/hcreate.html
Bug: https://bugs.dragonflybsd.org/issues/1398
DeltaFile
+52-61lib/libc/stdlib/hcreate.3
+0-1lib/libc/stdlib/hcreate.c
+52-622 files

DragonFlyBSD/src 72d8339 — sys/kern vfs_nlookup.c

kern: Fix write-open "." or ".." to return EISDIR instead of EEXIST

Before the fix, opening "." or ".." for write would return EEXIST, which
was incorrect per the POSIX spec:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html

where one would expect one of EISDIR, EINVAL, EACCES.

For example:

```
% sh -c 'echo xxx > /tmp/.'
sh: cannot create /tmp/.: File exists
```

Fix the code to return EISDIR.  Note that opening a directory other than
"." or ".." for write already returns EISDIR, e.g.,


    [6 lines not shown]
DeltaFile
+1-1sys/kern/vfs_nlookup.c
+1-11 files

DragonFlyBSD/src f86ce3f — lib/libc/stdlib hcreate.c hcreate.3

hcreate(3): Stop freeing key values

POSIX leaves ownership of ENTRY.key with the caller. NetBSD and FreeBSD
both stopped freeing key values in July 2014, and OpenBSD made the
change in August 2026.

Update the function description in the man page according to OpenBSD's;
adjust the example in the man page according to the POSIX spec.

OpenBSD: https://github.com/openbsd/src/commit/99858244924d27f541bdf37cb5565ee9525d7753
POSIX: https://pubs.opengroup.org/onlinepubs/9799919799/functions/hcreate.html
Bug: https://bugs.dragonflybsd.org/issues/1398
DeltaFile
+52-61lib/libc/stdlib/hcreate.3
+0-1lib/libc/stdlib/hcreate.c
+52-622 files

DragonFlyBSD/src d5838e7 — sys/kern vfs_nlookup.c

kern: Fix write-open "." or ".." to return EISDIR instead of EEXIST

Before the fix, opening "." or ".." for write would return EEXIST, which
was incorrect per the POSIX spec:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html

where one would expect one of EISDIR, EINVAL, EACCES.

For example:

```
% sh -c 'echo xxx > /tmp/.'
sh: cannot create /tmp/.: File exists
```

Fix the code to return EISDIR.  Note that opening a directory other than
"." or ".." for write already returns EISDIR, e.g.,


    [6 lines not shown]
DeltaFile
+1-1sys/kern/vfs_nlookup.c
+1-11 files

DragonFlyBSD/src 97960b5 — usr.bin/drill Makefile drill.1

drill(1): Update Makefile

* Generate the drill.1 man page from drill.1.in in the vendor source.
* Clean up the Makefile
DeltaFile
+0-249usr.bin/drill/drill.1
+18-5usr.bin/drill/Makefile
+18-2542 files

DragonFlyBSD/src c93d603 — lib/libldns Makefile, lib/libldns/ldns net.h util.h

libldns: Update generated headers and Makefile
DeltaFile
+40-14lib/libldns/ldns/config.h
+24-2lib/libldns/ldns/util.h
+2-5lib/libldns/Makefile
+1-2lib/libldns/ldns/net.h
+67-234 files

DragonFlyBSD/src 437f059 — contrib/ldns README.DELETED README.DRAGONFLY

contrib/ldns: Update our READMEs

Document the upgrade steps in README.DRAGONFLY.
DeltaFile
+29-16contrib/ldns/README.DRAGONFLY
+2-7contrib/ldns/README.DELETED
+31-232 files

DragonFlyBSD/src 68b9fd4 — contrib/ldns resolver.c host2str.c, contrib/ldns/drill drill.1.in

Merge branch 'vendor/LDNS'

Upgrade ldns from 1.8.3 to 1.9.2.
DeltaFile
+262-0contrib/ldns/drill/drill.1.in
+122-17contrib/ldns/rr.c
+125-0contrib/ldns/README
+94-4contrib/ldns/net.c
+74-6contrib/ldns/host2str.c
+21-50contrib/ldns/resolver.c
+698-7730 files not shown
+1,132-16436 files

DragonFlyBSD/src 7781f27 — contrib/ldns resolver.c host2str.c, contrib/ldns/drill drill.1.in

vendor/LDNS: Upgrade from 1.8.3 to 1.9.2
DeltaFile
+262-0contrib/ldns/drill/drill.1.in
+122-17contrib/ldns/rr.c
+125-0contrib/ldns/README
+94-4contrib/ldns/net.c
+74-6contrib/ldns/host2str.c
+21-50contrib/ldns/resolver.c
+698-7730 files not shown
+1,132-16436 files

DragonFlyBSD/src e1b2548 — lib/libnvmm libnvmm_x86.c

libnvmm: Improve the page walker

* Implement A/D bit setting.
* Inject #PFs on non-present pages when emulating MMIOs. This is needed
  for guests like Windows 2000 that aggressively page out memory that
  they then use in MMIO operations.
* Fix the '64bit walk - present' test that failed in the previous
  commit.

Obtained-from: NVMM Reference Implementation
DeltaFile
+410-187lib/libnvmm/libnvmm_x86.c
+410-1871 files

DragonFlyBSD/src 6f52ef5 — lib/libnvmm libnvmm.3 libnvmm_x86.c, test/testcases/libnvmm h_os.h h_mem_assist.c

libnvmm: Improve the correctness of page table walks

* Fix 32bit PAE: the top-level pdir doesn't have NX.
* Fix 32bit non-PAE: PTE_PS is ignored if CR4.PSE=0.
* Stop the walks early on if a required permission is not met.
* Take CR0.WP and EFER.NXE into account when evaluating permissions.
* Enforce SMEP/SMAP protections.
* Document the semantics of nvmm_gva_to_gpa() more clearly.
* Add unit-tests.

Note that the '64bit walk - present' test is failing, which will be
fixed in a later commit.

Obtained-from: NVMM Reference Implementation
DeltaFile
+139-91lib/libnvmm/libnvmm_x86.c
+119-6test/testcases/libnvmm/h_mem_assist.c
+10-4lib/libnvmm/libnvmm.3
+3-0test/testcases/libnvmm/h_os.h
+271-1014 files

DragonFlyBSD/src 6cda333 — test/testcases/libnvmm h_mem_assist.c

testcases/libnvmm: Fully reset the VCPU after each test

Otherwise if a fault is pending it gets injected in the next test.

Obtained-from: NVMM Reference Implementation
DeltaFile
+18-6test/testcases/libnvmm/h_mem_assist.c
+18-61 files

DragonFlyBSD/src eb95b47 — test/testcases/libnvmm h_misc.c h_io_assist.c

testcases/libnvmm: Don't depend on <machine/segments.h>

Obtained-from: NVMM Reference Implementation
DeltaFile
+14-14test/testcases/libnvmm/h_mem_assist.c
+13-2test/testcases/libnvmm/h_os.h
+7-7test/testcases/libnvmm/h_misc.c
+7-7test/testcases/libnvmm/h_io_assist.c
+41-304 files

DragonFlyBSD/src a5e22f8 — lib/libnvmm Makefile

libnvmm: Use -O2 optimization level for significant performance gain

Suggested-by: Maxime Villard
DeltaFile
+3-0lib/libnvmm/Makefile
+3-01 files

DragonFlyBSD/src a7418ac — lib/libnvmm libnvmm_x86.c

libnvmm: Fix -Winline warnings

GCC 12.5 would give the following -Winline warnings:

```
cc   -pipe -O   -ggdb3 -std=gnu11 -Wmissing-include-dirs -Wsystem-headers -Wall -Wformat-security -Winit-self -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wold-style-definition -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls  -Wno-pointer-sign -Wno-format-overflow -Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow -Wno-address-of-packed-member   -c libnvmm.c -o libnvmm.o
In file included from libnvmm.c:48:
libnvmm_x86.c: In function 'nvmm_gva_to_gpa':
libnvmm_x86.c:624:1: warning: inlining failed in call to 'x86_gva_to_gpa': --param max-inline-insns-single limit reached [-Winline]
  624 | x86_gva_to_gpa(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
      | ^~~~~~~~~~~~~~
libnvmm_x86.c:722:14: note: called from here
  722 |         es = x86_gva_to_gpa(mach, vcpu, gva, gpa, NVMM_PROT_READ, prot, false);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libnvmm_x86.c: In function 'read_guest_memory':
libnvmm_x86.c:624:1: warning: inlining failed in call to 'x86_gva_to_gpa': --param max-inline-insns-single limit reached [-Winline]
  624 | x86_gva_to_gpa(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
      | ^~~~~~~~~~~~~~
libnvmm_x86.c:944:14: note: called from here

    [18 lines not shown]
DeltaFile
+8-4lib/libnvmm/libnvmm_x86.c
+8-41 files

DragonFlyBSD/src 545fbde — lib/libnvmm libnvmm.c libnvmm_x86.c

libnvmm: Micro optimizations

Obtained-from: NVMM Reference Implementation
DeltaFile
+225-165lib/libnvmm/libnvmm_x86.c
+7-5lib/libnvmm/libnvmm.c
+232-1702 files

DragonFlyBSD/src d5fa4c7 — lib/libnvmm libnvmm_x86.c

libnvmm: Use a common helper to fetch instruction bytes

Obtained-from: NVMM Reference Implementation
DeltaFile
+46-67lib/libnvmm/libnvmm_x86.c
+46-671 files

DragonFlyBSD/src 78d0810 — lib/libnvmm libnvmm_x86.c, test/testcases/libnvmm h_mem_assist_asm.S

libnvmm: Fix MOVZX emulation

The overridden operand_size was being used to select the register, and
this did not match the actual desired register size. This could result
in the wrong register being written to, for example EBP would be decoded
as CH.

Update the existing unit-test to exercise this case.

Obtained-from: NVMM Reference Implementation
DeltaFile
+3-3test/testcases/libnvmm/h_mem_assist_asm.S
+4-1lib/libnvmm/libnvmm_x86.c
+7-42 files

DragonFlyBSD/src 3bfa046 — sys/dev/virtual/nvmm nvmm_os.h nvmm_netbsd.c

nvmm: Improve OS independence

* Add os_copy_from_user() and os_copy_to_user() helpers.
* Split os_vmobj_map() into os_vmobj_map_{user,kern}(), which are the
  same for DragonFly and NetBSD; this helps the Haiku port.

Obtained-from: NVMM Reference Implementation
DeltaFile
+8-8sys/dev/virtual/nvmm/nvmm.c
+12-2sys/dev/virtual/nvmm/nvmm_netbsd.c
+12-2sys/dev/virtual/nvmm/nvmm_dragonfly.c
+10-2sys/dev/virtual/nvmm/nvmm_os.h
+42-144 files

DragonFlyBSD/src 9af6e5d — sys/dev/virtual/nvmm/x86 nvmm_x86_svmfunc.S

nvmm: Micro-optimize one instruction in svm_vmrun()

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

DragonFlyBSD/src 9bd9bca — sys/dev/virtual/nvmm/x86 nvmm_x86_svm.c nvmm_x86_internal.h

nvmm: Make the ASM files more OS-independent

* Introduce OS-independent ASM_FUNCTION and ASM_END macros.
* Move the OS-dependant bits to nvmm_x86_internal.h.
* Fetch the hgdt pointer in C with os_curcpu_gdt(), so svm_vmrun()
  becomes OS-independent.
* Use RIP-relative addressing in vmx_insn_fail{valid,invalid}.

Obtained-from: NVMM Reference Implementation
DeltaFile
+14-30sys/dev/virtual/nvmm/x86/nvmm_x86_vmxfunc.S
+7-33sys/dev/virtual/nvmm/x86/nvmm_x86_svmfunc.S
+25-0sys/dev/virtual/nvmm/x86/nvmm_x86_internal.h
+5-2sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+51-654 files

DragonFlyBSD/src 1085a76 — sys/dev/virtual/nvmm/x86 nvmm_x86_internal.h nvmm_x86_svm.c

nvmm: Ignore MSR_LS_CFG (0xC0011020) on AMD CPUs

On older AMD CPUs that do not support SSBD mitigations, Linux falls
back to writing to MSR_LS_CFG on each context switch if this MSR
exists. This creates significant noise in the QEMU output.

We can't simply inject #GP for accesses to this MSR, as that may
break compatibility with older guests which assume that MSR_LS_CFG
is present based solely on the reported CPU family and model.

So just ignore this MSR completely. This fixes a QEMU output storm
on Arch Linux (tested with archlinux-2019.05.02-x86_64.iso).

Obtained-from: NVMM Reference Implementation
DeltaFile
+4-2sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+1-0sys/dev/virtual/nvmm/x86/nvmm_x86_internal.h
+5-22 files

DragonFlyBSD/src efd00cf — sys/dev/virtual/nvmm/x86 nvmm_x86_svm.c

nvmm: Simplify the VMCB cache handling

Obtained-from: NVMM Reference Implementation
DeltaFile
+13-24sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+13-241 files

DragonFlyBSD/src e45a952 — sys/dev/virtual/nvmm/x86 nvmm_x86.h nvmm_x86_svm.c

nvmm: Support cache and process topology CPUID info for SVM

Support CPUIDs 0x8000001D and 0x8000001E for SVM.

Obtained-from: NVMM Reference Implementation
DeltaFile
+25-1sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+14-0sys/dev/virtual/nvmm/x86/nvmm_x86.h
+39-12 files

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

nvmm: Don't push exception error codes in real-mode guests

In real mode there are no error codes.

Obtained-from: NVMM Reference Implementation
DeltaFile
+8-5sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+5-4sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+13-92 files

DragonFlyBSD/src 2543a4c — sys/dev/virtual/nvmm/x86 nvmm_x86_svm.c

nvmm: Fix SWINT reinjection in svm_exit_evt()

AMD CPUs have an issue where they may not set nrip if a VMEXIT
occurs during a SWINT event. Work around it by not reinjecting
SWINTs and just letting the guest re-execute the INT instruction.

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

DragonFlyBSD/src 35be1f3 — sys/dev/virtual/nvmm/x86 nvmm_x86_vmx.c nvmm_x86_svm.c

nvmm: Optimize *_vcpu_guest_fpu_enter() in *_vcpu_run()

Suggested-by: Maxime Villard
DeltaFile
+1-3sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c
+1-3sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c
+2-62 files

DragonFlyBSD/src c76ea56 — sbin/mount mount.c

mount(8): Detect known filesystem types in raw GPT partitions

mount(8) previously only guessed the filesystem from the disklabel
fstype.  DIOCGPART already puts the GPT partition type UUID in
partinfo.fstype_uuid, but mount(8) never looked at it.  A raw GPT
partition has fstype 0, so mount(8) would warn and fall back to ufs.

Update checkdisklabel() to look the fstype_uuid up in a table of known
GPT partition types (EFI -> msdos, the DragonFly/FreeBSD native types ->
ufs/hammer/hammer2) if the disklabel fstype does not map.  Unknown GPT
partition types keep the old warning and ufs fallback.

Bug: #3401
DeltaFile
+43-12sbin/mount/mount.c
+43-121 files

DragonFlyBSD/src ffd4b44 — stand/boot/efi/loader Makefile, stand/boot/efi/loader/arch/x86_64 ldscript.x86_64

efi/loader: Improve the linker script and LDFLAGS

* Remove the stale comment of `.hash`, which is empty under the default
  `--hash-style=gnu`.  The image base is also pinned by
  `. = 0; ImageBase = .`.

* Fold the remaining linker-generated PLT sections (`.plt.*` and `.iplt`)
  into `.text` so the `objcopy -j .text` can never drop them.

* Add `-Wl,-z,defs` to fail the link if there are unresolved symbols,
  instead of generating PLT entries for them.

* Add `-Wl,--no-eh-frame-hdr` to skip generating the `.eh_frame_hdr`
  section because it's never copied into the final `loader.efi`
  executable.  What's worse, the generation sidesteps a bug in
  bintuils/bfd that produced the misleading overlapping FDEs error, as
  observed in the previous commit.

Assisted-by: DeepSeek-v4.1-flash (with Pi Coding Agent)
DeltaFile
+6-0stand/boot/efi/loader/Makefile
+2-2stand/boot/efi/loader/arch/x86_64/ldscript.x86_64
+8-22 files

DragonFlyBSD/src 34c6dca — stand/boot/efi/loader Makefile

efi/loader: Fix libstand.a order in LDADD

When I tried to use `strtok()` in `boot/dloader`, the `stand/efi/loader`
would fail the linking with an obscure error:

```
cc -pipe -O1   -fno-stack-protector -fPIC -I/usr/src/stand/boot/efi/loader/../../../contrib/edk2/MdePkg/Include -I/usr/src/stand/boot/efi/loader/../../../contrib/edk2/MdePkg/Include/X64 -I/usr/src/stand/boot/efi/loader/../../../contrib/edk2/MdeModulePkg/Include -I/usr/src/stand/boot/efi/loader -I/usr/src/stand/boot/efi/loader/arch/x86_64 -I/usr/src/stand/boot/efi/loader/../include -I/usr/src/stand/boot/efi/loader/../../../../sys/contrib/dev/acpica/source/include -I/usr/src/stand/boot/efi/loader/../../../../sys -I/usr/src/stand/boot/efi/loader/../../pc32/libi386 -I/usr/src/stand/boot/efi/loader/../../dloader -I/usr/src/stand/boot/efi/loader/../../../lib -DNO_PCI -DEFI -I/usr/src/stand/boot/efi/loader/../../common -O -D_STANDALONE -ffreestanding -Wformat -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fshort-wchar -mno-red-zone -mno-aes   -std=gnu11 -Wmissing-include-dirs -Wsystem-headers -Wall -Wformat-security -Winit-self -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wold-style-definition  -Wno-pointer-sign -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-format-overflow -Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow -Wno-address-of-packed-member -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Wno-unused-value -Wno-implicit-fallthrough  -Wl,-znocombreloc -Wl,-T/usr/src/stand/boot/efi/loader/arch/x86_64/ldscript.x86_64 -Wl,-Bsymbolic -shared -nostdlib -o loader.sym autoload.o bootinfo.o conf.o copy.o devicename.o efi_main.o i386_module.o main.o self_reloc.o smbios.o vers.o amd64_tramp.o start.o framebuffer.o elf64_freebsd.o nullconsole.o comconsole.o bcache.o boot.o commands.o console.o devopen.o interp_backslash.o interp_parse.o ls.o misc.o module.o panic.o rel_open.o load_elf32.o load_elf32_obj.o reloc_elf32.o load_elf64.o load_elf64_obj.o reloc_elf64.o do_dloader.o /usr/obj/usr/src/world_x86_64/usr/src/stand/boot/efi/loader/../libefi/libefi.a /usr/obj/usr/src/world_x86_64/usr/src/stand/boot/efi/loader/../../../lib/libstand.a /usr/obj/usr/src/world_x86_64/usr/src/stand/boot/efi/loader/../../dloader/libdloader.a
/usr/obj/usr/src/ctools_x86_64_x86_64/usr/libexec/binutils234/elf/ld.bfd: .eh_frame_hdr refers to overlapping FDEs
/usr/obj/usr/src/ctools_x86_64_x86_64/usr/libexec/binutils234/elf/ld.bfd: final link failed: bad value
collect2: error: ld returned 1 exit status
```

Reproducing the failing link with `ld.bfd --no-eh-frame-hdr` and dumping
`.eh_frame` showed:

```
00000018  00000014  FDE cie=0  pc=0x6000..0x600e   <- efi_autoload (autoload.o)
00000030  00000024  FDE cie=0  pc=0x6000..0x6020   <- PLT .eh_frame
00000058  00000050  FDE cie=0  pc=0x600e..0x63ab   <- bi_copymodules (bootinfo.o)

    [27 lines not shown]
DeltaFile
+2-2stand/boot/efi/loader/Makefile
+2-21 files