Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (626 w, 6 d)

Recent Activity

Yesterday

kib committed rGace4a3e177c0: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock (authored by kib).
vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock
Thu, May 21, 8:13 PM
kib committed rGf5433e784078: vfs_domount(): handle the case when vn_lock_pair() only locked once (authored by kib).
vfs_domount(): handle the case when vn_lock_pair() only locked once
Thu, May 21, 8:13 PM
kib closed D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.
Thu, May 21, 8:13 PM
kib updated the diff for D57124: sys: add pdopenpid(2).

Assert that P_WEXIT is set in procdesc_exit(), It is trivially true because procdesc_exit() is only called from exit1() after single-threading.
Assert that pd->pd_fcount > 0 when pd already found in kern_pdopenpid().
Fix the arg number in bsm.
Write some documentation for the interface. Try to explain the quirk of multiple pdopenpid()s,

Thu, May 21, 5:42 PM
kib added inline comments to D57134: sendfile: Fix bug when using headers with SW KTLS offload.
Thu, May 21, 4:10 PM
kib updated the diff for D57124: sys: add pdopenpid(2).

Handle review notes except pd_fpcount == 0/PDF_DAEMON case.

Thu, May 21, 4:09 PM
kib added inline comments to D57124: sys: add pdopenpid(2).
Thu, May 21, 4:07 PM
kib added a comment to D55203: svc_vc.c: Add support for an xp_extpg boolean.

I think it could be set to 'enabled' for machines with DMAP, i.e. amd64/arm64, and might be risc-v, if anybody ever uses nfs server on it. For other arches, the knob almost surely should be kept disabled.
mb_unmapped_to_ext() uses non-privately mapped sfbufs for all extents of mbufs. On DMAP systems, it is free. On other arches, allocating such sfbuf causes global IPI, and the whole chain of sfbufs is freed only after the mbufs are released by the network card. Besides the cost of allocating , this would make sfbufs scarce resource for other consumers and even for nfs server itself. There are around ~1K of sfbufs, and it mb_unmapped_to_ext() seems to drop packet if an sfbuf cannot be allocated immediately.

Thu, May 21, 2:45 PM
kib added a reviewer for D57124: sys: add pdopenpid(2): markj.
Thu, May 21, 2:20 PM
kib added a comment to D57149: tests/procdesc: Use a more efficient mechanism to block.
In D57149#1309603, @kib wrote:

I would also consider adding some timeout by counting the number of usleep() calls, to avoid infinite wait.

kyua itself provides a timeout mechanism, I think it's ok to rely on that?

Thu, May 21, 2:19 PM
kib accepted D57149: tests/procdesc: Use a more efficient mechanism to block.

I would also consider adding some timeout by counting the number of usleep() calls, to avoid infinite wait.

Thu, May 21, 2:15 PM
kib added inline comments to D57134: sendfile: Fix bug when using headers with SW KTLS offload.
Thu, May 21, 9:34 AM
kib added a comment to D57002: Bug 295139 - kldload prints wrong error message to terminal upon attempt to load incorrect module version.

exterr_cat_filenames.h should be regenerated.

Thu, May 21, 8:11 AM
kib updated the diff for D57124: sys: add pdopenpid(2).

Track number of open files for given procdesc. Drop PDF_CLOSED flag.

Thu, May 21, 12:53 AM

Wed, May 20

kib added a comment to D57038: ntsync(9).

Thanks for the work, could it be possible to have the ntsync.h headers available in a path that can be resolved by:

<linux/ntsync.h>

This would make it easier to use it with wine since then no specific code for FreeBSD would be necessary which I would assume is the main objective to this kernel module.

Wed, May 20, 11:44 PM
kib committed rGd9c31658df84: kern_umtx.c: remove dead code (authored by kib).
kern_umtx.c: remove dead code
Wed, May 20, 1:32 PM
kib closed D57122: kern_umtx.c: remove dead code.
Wed, May 20, 1:31 PM
kib updated the diff for D57124: sys: add pdopenpid(2).

Allow to have more than one file referencing procdesc.
I am unable to find a broken situation, so lift the restriction.

Wed, May 20, 12:31 PM
kib updated the diff for D57038: ntsync(9).

Fix memory leak in cleanup for EINVAL when waiting for the same object twice in WAIT_ALL.

Wed, May 20, 12:30 PM
kib updated the diff for D57124: sys: add pdopenpid(2).

Provide dedicated error values for cases when the target process is exiting, or when the procdesc is already allocated for it.

Wed, May 20, 5:38 AM
kib added a comment to D57124: sys: add pdopenpid(2).

Illustrative program

/* $Id: pdopenpid.c,v 1.1 2026/05/20 05:16:25 kostik Exp kostik $ */
Wed, May 20, 5:18 AM
kib updated subscribers of D57124: sys: add pdopenpid(2).
Wed, May 20, 2:29 AM
kib updated subscribers of D57124: sys: add pdopenpid(2).
Wed, May 20, 2:27 AM
kib requested review of D57124: sys: add pdopenpid(2).
Wed, May 20, 2:25 AM
kib updated the diff for D57122: kern_umtx.c: remove dead code.

Minor wording

Wed, May 20, 12:58 AM
kib requested review of D57122: kern_umtx.c: remove dead code.
Wed, May 20, 12:55 AM
kib updated the diff for D57038: ntsync(9).

Fix !DEBUG build.
Fix headers installation.

Wed, May 20, 12:44 AM
kib added a comment to D57038: ntsync(9).

From build testing with the latest changes, I've ran into 3 build errors and have suggested fixes for each:

Wed, May 20, 12:44 AM
kib committed rGe6623a912911: locking.9: warn about using sleepable lock address as a sleep channel (authored by kib).
locking.9: warn about using sleepable lock address as a sleep channel
Wed, May 20, 12:34 AM

Tue, May 19

kib updated the diff for D57038: ntsync(9).

Make tests in linuxolator pass fully.

Tue, May 19, 12:20 PM
kib updated the diff for D57038: ntsync(9).

linux compat mostly works.
Match native FreeBSD ioctl args with Linux counterparts.

Tue, May 19, 9:00 AM
kib accepted D57044: tmpfs: Overhaul option handling on remount.
Tue, May 19, 5:42 AM
kib updated the diff for D57038: ntsync(9).

Add linux compat code. Cannot test with linux test, since it uses pidfd calls which are not implemented.

Tue, May 19, 5:39 AM
kib committed rGf6f5eb319016: linux/linux_common.h: make header self-contained (authored by kib).
linux/linux_common.h: make header self-contained
Tue, May 19, 4:24 AM
kib accepted D57034: nlist: Handle multiple symbol tables.
Tue, May 19, 1:52 AM

Mon, May 18

kib added inline comments to D57034: nlist: Handle multiple symbol tables.
Mon, May 18, 11:41 PM
kib accepted D57078: nlist.3: Add deprecation notice.

Could you please also document the '_' quirk?

Mon, May 18, 11:35 PM
kib added inline comments to D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.
Mon, May 18, 11:34 PM
kib accepted D57034: nlist: Handle multiple symbol tables.
Mon, May 18, 11:17 PM
kib added inline comments to D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.
Mon, May 18, 10:59 PM
kib updated the diff for D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.

Return status from vn_lock_pair().

Mon, May 18, 10:56 PM
kib accepted D57065: nlist.3: Clarify which symbol table is used.

I do not believe that strip could remove section headers. It is either linker script or linker which would do that, or some more involved ELF editing tool.
Point is that rtld does not need sections at all.

Mon, May 18, 10:54 PM
kib added a comment to D57065: nlist.3: Clarify which symbol table is used.

I would also mention that the function uses section headers to look up symtab, which means that a legitimate binary with sections stripped would not work.

Mon, May 18, 9:57 PM
kib added inline comments to D56989: amd64: Drop segment descriptor details from trap messsages.
Mon, May 18, 9:39 PM
kib updated the diff for D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.

Make vfs_mount() handle a possibility that covered vp and new mount fs rootvp share the locks.

Mon, May 18, 8:39 AM
kib added inline comments to D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.
Mon, May 18, 8:38 AM
kib updated the diff for D57038: ntsync(9).

Report some info on stat(2)

Mon, May 18, 7:44 AM
kib updated the diff for D57038: ntsync(9).

Report kinfo for ntsync filedescs.
Minor tweaks overall.

Mon, May 18, 7:29 AM

Sun, May 17

kib committed rG8ad8643a6673: ufs: ufs_bmap_seekdata() needs mapped buffer for scan (authored by kib).
ufs: ufs_bmap_seekdata() needs mapped buffer for scan
Sun, May 17, 10:10 PM
kib closed D57036: ufs: ufs_bmap_seekdata() needs mapped buffer for scan.
Sun, May 17, 10:09 PM
kib added a comment to D57054: sys/x86/x86/ucode.c: Do not use wrmsr_early_safe() for Intel.
In D57054#1307333, @jrm wrote:
In D57054#1307326, @kib wrote:

I looked at the referenced bug. Could you please conduct an experiment where the failing machine is booting kernel with just the WRMSR write to actually update the ucode is commented out? I mean, remove only the instruction, but keep the setup for wrmsr_safe intact. Does the machine boot in this case?

I'll try to answer both questions here.

My understanding of this is not much beyond this: Commit d9f03a43f2fe seemed the most likely change to have caused a problem, especially since @glebius said Intel wasn't tested.

Sun, May 17, 9:37 PM
kib added inline comments to D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.
Sun, May 17, 9:20 PM
kib committed rG56bc43f5d02b: locking.9: warn about using sleepable lock address as a sleep channel (authored by kib).
locking.9: warn about using sleepable lock address as a sleep channel
Sun, May 17, 7:56 PM
kib closed D57012: locking.9: warn about using sleepable lock address as a sleep channel.
Sun, May 17, 7:56 PM
kib added inline comments to D57012: locking.9: warn about using sleepable lock address as a sleep channel.
Sun, May 17, 7:54 PM
kib committed rG7bdf2b5d5fba: nullfs: do not allow to mount a vnode over itself (authored by kib).
nullfs: do not allow to mount a vnode over itself
Sun, May 17, 7:45 PM
kib closed D57043: nullfs: do not allow to mount a vnode over itself.
Sun, May 17, 7:45 PM
kib added inline comments to D57034: nlist: Handle multiple symbol tables.
Sun, May 17, 7:25 PM
kib added a comment to D57034: nlist: Handle multiple symbol tables.

But after the dlopen(RTLD_DEFER_INIT), would the object participate in the symbol resolution? If yes, it is unsafe. If no, it is probably too hard to implement for the effect.

Sun, May 17, 7:20 PM
kib added a comment to D57044: tmpfs: Overhaul option handling on remount.

Please change the title from 'Overhaul remount handling' to 'Overhaul remount options handling'.
Quite non-trivial part of the remount handling for tmpfs is rw->ro remount, and from the title I thought that you rewrote that.

Sun, May 17, 7:14 PM
kib added a comment to D57054: sys/x86/x86/ucode.c: Do not use wrmsr_early_safe() for Intel.

I looked at the referenced bug. Could you please conduct an experiment where the failing machine is booting kernel with just the WRMSR write to actually update the ucode is commented out? I mean, remove only the instruction, but keep the setup for wrmsr_safe intact. Does the machine boot in this case?

Sun, May 17, 7:08 PM
kib added a comment to D57054: sys/x86/x86/ucode.c: Do not use wrmsr_early_safe() for Intel.
In D57054#1307284, @imp wrote:

What are the risks this a avoids?

Sun, May 17, 6:45 PM
kib updated the diff for D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.

Handle NULL parameters.

Sun, May 17, 8:48 AM
kib updated subscribers of D57043: nullfs: do not allow to mount a vnode over itself.
Sun, May 17, 8:10 AM
kib requested review of D57043: nullfs: do not allow to mount a vnode over itself.
Sun, May 17, 8:10 AM
kib updated subscribers of D57038: ntsync(9).
Sun, May 17, 7:09 AM
kib requested review of D57038: ntsync(9).
Sun, May 17, 7:08 AM
kib added a comment to D57036: ufs: ufs_bmap_seekdata() needs mapped buffer for scan.

Why does ufs_bmap_seekdata() cause a panic when it uses an unmapped buffer?

Sun, May 17, 4:37 AM
kib committed rGbce6e0e90328: ptrace: clear TDP_USERWR after transparent attach only on attach (authored by kib).
ptrace: clear TDP_USERWR after transparent attach only on attach
Sun, May 17, 12:30 AM
kib committed rG0093bb670537: [libm] implementation of rsqrt, rsqrtf, and rsqrtl (authored by Steve Kargl <kargl@FreeBSD.org>).
[libm] implementation of rsqrt, rsqrtf, and rsqrtl
Sun, May 17, 12:30 AM
kib committed rGc34ca8fb21fa: sys/cdefs.h: move __BEGIN_DECLS/__END_DECLS into a helper sys/_decls.h (authored by kib).
sys/cdefs.h: move __BEGIN_DECLS/__END_DECLS into a helper sys/_decls.h
Sun, May 17, 12:30 AM
kib requested review of D57036: ufs: ufs_bmap_seekdata() needs mapped buffer for scan.
Sun, May 17, 12:12 AM

Sat, May 16

kib added a comment to D57034: nlist: Handle multiple symbol tables.

For purposes of ssh, is it ever right to look into the non-dynamic symbols? And if not, should it use dlsym() instead?

Sat, May 16, 11:33 PM
kib requested review of D57035: vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock.
Sat, May 16, 11:29 PM
kib committed rG43a8585cb2bb: sys/mount.h: restore KNF_NOKQLOCK in VFS_KNOTE_{,UN}LOCKED() call to KNOTE() (authored by kib).
sys/mount.h: restore KNF_NOKQLOCK in VFS_KNOTE_{,UN}LOCKED() call to KNOTE()
Sat, May 16, 11:24 PM
kib committed rG72ab129799a2: x86: remove sys/mount.h from genassym.c (authored by kib).
x86: remove sys/mount.h from genassym.c
Sat, May 16, 9:43 PM
kib committed rG8dd43304b397: amd64/ptrace-sce-tamper test: get rid of PT_TRACE_ME (authored by iwtcex_gmail.com).
amd64/ptrace-sce-tamper test: get rid of PT_TRACE_ME
Sat, May 16, 7:43 PM
kib added a reviewer for D57026: lacp: simplify lacp_compose_key(): slavash.
Sat, May 16, 4:07 AM

Fri, May 15

kib accepted D57014: jail: replace PR_ALLOW_ALL_STATIC hex constant with symbolic OR.
Fri, May 15, 1:03 PM
kib updated the diff for D57012: locking.9: warn about using sleepable lock address as a sleep channel.

Reword the sentence.

Fri, May 15, 11:44 AM
kib added inline comments to D57012: locking.9: warn about using sleepable lock address as a sleep channel.
Fri, May 15, 11:43 AM
kib requested review of D57012: locking.9: warn about using sleepable lock address as a sleep channel.
Fri, May 15, 11:08 AM

Thu, May 14

kib accepted D56967: jail: add allow.mount.unsafe.all to allow mounting any filesystem.
Thu, May 14, 9:16 PM
kib added a comment to D56989: amd64: Drop segment descriptor details from trap messsages.
In D56989#1306035, @jhb wrote:
In D56989#1305907, @kib wrote:

For me, the segment registers values from the trap frame appeared to be very useful and sometimes even instrumental, e.g. during the recent FRED work. If the kernel idea of the trap frame address is misaligned with the location where the hardware put it, segment values are canaries that allow to see that immediately. Also, bugs with segments handling in doreti or fred_gouser are relatively obvious then. I am asking to keep that in the frame dump.

Ok. Do you care about there code segment details from the GDT?

Thu, May 14, 8:55 PM
kib added a comment to D56997: sys: Use is_pci_device instead of direct comparisons to devclasses.

x86/iommu part is certainly fine.

Thu, May 14, 8:54 PM
kib accepted D56996: pci: Add is_pci_device helper function.
Thu, May 14, 8:54 PM
kib accepted D57005: subr_uio.c: Remove a KASSERT() to allow large NFS server I/O.
Thu, May 14, 8:45 PM
kib committed rGe71e7dd6176e: fdescfs: do not change vnode type on VOP_GETATTR() (authored by kib).
fdescfs: do not change vnode type on VOP_GETATTR()
Thu, May 14, 2:35 AM
kib committed rGcd1e479361bf: amd/int0x80 test: fix inline asm for gcc (authored by rlibby).
amd/int0x80 test: fix inline asm for gcc
Thu, May 14, 12:58 AM
kib committed rG871bf8a8a063: vm_map_growstack(): use local for p->p_vmspace (authored by kib).
vm_map_growstack(): use local for p->p_vmspace
Thu, May 14, 12:57 AM
kib committed rG1aa72148d19f: vm_map_growstack(): give a hint to user that stack was blown out (authored by kib).
vm_map_growstack(): give a hint to user that stack was blown out
Thu, May 14, 12:57 AM
kib committed rG43c00fbfe676: bufspace_wait(): only try to help bufdaemon if there is a chance to help (authored by kib).
bufspace_wait(): only try to help bufdaemon if there is a chance to help
Thu, May 14, 12:57 AM
kib committed rGe0e4d7b1f1c2: vm_map_growstack(): consistently use local vars instead of curthread/proc (authored by kib).
vm_map_growstack(): consistently use local vars instead of curthread/proc
Thu, May 14, 12:57 AM
kib committed rG5af938fb03d0: fdescfs: do not change vnode type on VOP_GETATTR() (authored by kib).
fdescfs: do not change vnode type on VOP_GETATTR()
Thu, May 14, 12:57 AM

Wed, May 13

kib added a comment to D56989: amd64: Drop segment descriptor details from trap messsages.

For me, the segment registers values from the trap frame appeared to be very useful and sometimes even instrumental, e.g. during the recent FRED work. If the kernel idea of the trap frame address is misaligned with the location where the hardware put it, segment values are canaries that allow to see that immediately. Also, bugs with segments handling in doreti or fred_gouser are relatively obvious then. I am asking to keep that in the frame dump.

Wed, May 13, 8:24 PM
kib accepted D56971: linux/io: handle memtype_wc mapping for !DMAP range.

On amd64 it is certainly enough to check PHYS_IN_DMAP(start+size), since DMAP always goes from 0 to TOP. Not sure about other arches.

Wed, May 13, 8:19 PM
kib committed rGbab04ddf1fd4: ufs: support unmapped bufs for indirect blocks in bmap (authored by chs).
ufs: support unmapped bufs for indirect blocks in bmap
Wed, May 13, 7:48 PM
kib closed D53424: ufs: support unmapped bufs for indirect blocks in bmap.
Wed, May 13, 7:48 PM
kib committed rGcb31a266167c: ptrace: clear TDP_USERWR after transparent attach only on attach (authored by kib).
ptrace: clear TDP_USERWR after transparent attach only on attach
Wed, May 13, 7:41 PM
kib closed D56928: ptrace: clear TDP_USERWR after transparent attach only on attach.
Wed, May 13, 7:40 PM