Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (645 w, 4 d)

Recent Activity

Today

kib accepted D59872: cuse: Improve server cleanup.
Wed, Sep 30, 1:10 AM
kib added inline comments to D60134: ufs: make fdatasync(2), O_SYNC and O_DSYNC writes durable.
Wed, Sep 30, 1:00 AM
kib committed rGc121ed33cde5: linuxkpi: Fix double-cleanup in linux_pci_attach_device() error path (authored by slavash).
linuxkpi: Fix double-cleanup in linux_pci_attach_device() error path
Wed, Sep 30, 12:54 AM

Yesterday

kib added inline comments to D59356: ffs: revalidate mkdir dependencies after vnode lookup.
Tue, Sep 29, 10:26 PM · Contributor Reviews (src)
kib added inline comments to D60137: ufs: report why rewriting ".." failed in rename.
Tue, Sep 29, 9:37 PM
kib committed rG233b6efe5f2f: pdfork.2: downgrade sections inside description to subsections (authored by kib).
pdfork.2: downgrade sections inside description to subsections
Tue, Sep 29, 8:05 PM
kib committed rGcc467e45136d: amd64/mp_machdep.c: remove double 'for' in comment (authored by kib).
amd64/mp_machdep.c: remove double 'for' in comment
Tue, Sep 29, 8:05 PM
kib accepted D60022: cuse: Implement hot-unload.
Tue, Sep 29, 11:01 AM
kib committed rG54cb4bf00b82: amd64: gate WRMSRNS immediate form on compiler support (authored by brooks).
amd64: gate WRMSRNS immediate form on compiler support
Tue, Sep 29, 12:32 AM
kib committed rGc52f99acee2a: amd64: use WRMSRNS immediate form to update splitlock control, when available (authored by kib).
amd64: use WRMSRNS immediate form to update splitlock control, when available
Tue, Sep 29, 12:32 AM
kib committed rG0dce4f2a39dc: amd64: cache MSR_MEMORY_CTL in pcpu (authored by kib).
amd64: cache MSR_MEMORY_CTL in pcpu
Tue, Sep 29, 12:32 AM
kib committed rGd95433ec84b9: amd64: add userspace control for disabling splitlocks (authored by kib).
amd64: add userspace control for disabling splitlocks
Tue, Sep 29, 12:32 AM
kib committed rG6d6a82416b88: amd64: support for tracking per-thread 'disable splitlocks' state (authored by kib).
amd64: support for tracking per-thread 'disable splitlocks' state
Tue, Sep 29, 12:32 AM
kib committed rGb4a9afdf70e3: amd64: calculate if hardware supports disabling splitlocks (authored by kib).
amd64: calculate if hardware supports disabling splitlocks
Tue, Sep 29, 12:32 AM
kib committed rG77a99f36ba4f: amd64: handle #AC in kernel mode (authored by kib).
amd64: handle #AC in kernel mode
Tue, Sep 29, 12:32 AM
kib committed rG61412c0ff5cc: amd64 cpufunc.h: add WRMSRNS helpers (authored by kib).
amd64 cpufunc.h: add WRMSRNS helpers
Tue, Sep 29, 12:32 AM
kib committed rGca7aa1c162c1: amd64: add md thread flags word (authored by kib).
amd64: add md thread flags word
Tue, Sep 29, 12:32 AM
kib updated the diff for D60035: chaltroot(2).

Teach procstat(1), fstat(1), and fuser(1) about altroot.

Tue, Sep 29, 12:25 AM

Mon, Sep 28

kib updated the diff for D60035: chaltroot(2).

Drop altroot for setid native binaries.
Man page fixes and clarifications.

Mon, Sep 28, 9:55 PM
kib added a comment to D60035: chaltroot(2).

Neat feature, what is the motivation?

Mon, Sep 28, 9:42 PM
kib accepted D60033: pcib: Only apply ARI translation to a bridge's own secondary bus.
Mon, Sep 28, 8:19 PM
kib added a comment to D60022: cuse: Implement hot-unload.

Just a question, did you tested d_purge with the WITNESS kernel?

Mon, Sep 28, 7:39 PM
kib accepted D60043: cuse: Assert the server refcount.
Mon, Sep 28, 7:31 PM
kib updated the diff for D60047: sysarch.x86.2: manual page for the sysarch(2) functions on x86.

Move the man page to libsys/x86

Mon, Sep 28, 6:40 PM
kib updated the diff for D60047: sysarch.x86.2: manual page for the sysarch(2) functions on x86.

Apply jhb editings

Mon, Sep 28, 6:37 PM
kib added a comment to D60047: sysarch.x86.2: manual page for the sysarch(2) functions on x86.

Thank you very much for reading it so far.
Obviously I cannot get (the) articles right, I gave up on this many tens of years ago.

Mon, Sep 28, 6:35 PM
kib added inline comments to D59356: ffs: revalidate mkdir dependencies after vnode lookup.
Mon, Sep 28, 5:48 PM · Contributor Reviews (src)
kib added a comment to D59477: pci: Verify bus-master enable and disable readback.

So I got the answer people that actually implement PCIe config space (for some unnamed high-profile PCIe device). The implementation of it is in fw for all practical purposes. The pending TLP bit is always zero.

Mon, Sep 28, 9:29 AM
kib updated the diff for D59883: linuxkpi: lkpi_vmf_insert_special_pte_locked().

Stop busying already busy page, returned by the grab, avoiding deadlock.

Mon, Sep 28, 5:13 AM
kib updated the diff for D60035: chaltroot(2).

Bug fixes for disabling altroot mode:

  • make chroot -A not bail with an error
  • avoid NULL deref in MAC hook
Mon, Sep 28, 4:18 AM
kib committed rG9d436d9f2a22: amd64/*sigtramp.S: re-enable some cfi annotations for special registers (authored by kib).
amd64/*sigtramp.S: re-enable some cfi annotations for special registers
Mon, Sep 28, 1:05 AM
kib committed rGd1c4838a7464: x86: add cpu_stdext_feature5 (authored by kib).
x86: add cpu_stdext_feature5
Mon, Sep 28, 1:05 AM
kib committed rGd504e582a9db: x86: add definitions for the CORE_CAP and MEMORY_CTL MSRs (authored by kib).
x86: add definitions for the CORE_CAP and MEMORY_CTL MSRs
Mon, Sep 28, 1:05 AM
kib updated the diff for D60035: chaltroot(2).

Teach chroot(8) about altroot.

Mon, Sep 28, 12:28 AM

Sun, Sep 27

kib committed rG4472a048cf95: libthr: GC pshared locks not more than each 25msecs by default (authored by kib).
libthr: GC pshared locks not more than each 25msecs by default
Sun, Sep 27, 11:51 PM
kib committed rGc2f66b661642: libthr.3: document LIBPTHREAD_PSHARED_LOCK_DESTROY_IMMEDIATE_GC (authored by kib).
libthr.3: document LIBPTHREAD_PSHARED_LOCK_DESTROY_IMMEDIATE_GC
Sun, Sep 27, 11:51 PM
kib added inline comments to D59872: cuse: Improve server cleanup.
Sun, Sep 27, 9:58 PM
kib added a comment to D60022: cuse: Implement hot-unload.
In D60022#1377269, @kib wrote:

We have d_purge cdevsw method. It is invoked by destroy_dev(9) when it observes threads inside cdevsw methods, to release the sleep. Would it be useful for your purpose there?

I see only one use of d_purge in the tree. What I want is to wake up the server cv that's sleeping in CUSE_IOCTL_GET_COMMAND and set is_closing. I guess d_purge should be good, or is there something that might bite us?

Sun, Sep 27, 9:23 PM
kib accepted D60043: cuse: Assert the server refcount.
Sun, Sep 27, 9:20 PM
kib updated the diff for D60035: chaltroot(2).

Add fchaltroot(2)
Add mac callback
Documentation

Sun, Sep 27, 9:13 PM
kib committed rG16a284b1cdfd: linux(4): Fix signal mask restoration in epoll_pwait(2)/epoll_pwait2(2) (authored by Grzegorz Junka <list1@gjunka.com>).
linux(4): Fix signal mask restoration in epoll_pwait(2)/epoll_pwait2(2)
Sun, Sep 27, 7:27 PM

Sat, Sep 26

kib updated the diff for D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

Drop fhstat(2) chunk.

Sat, Sep 26, 11:20 PM
kib updated the diff for D60035: chaltroot(2).

Plug newpwd leak.

Sat, Sep 26, 11:18 PM
kib added a comment to D60035: chaltroot(2).
In D60035#1377674, @kib wrote:

Extract chroot_unpriv() from kern_chroot.
Use the same privilege checks for chaltroot(2) as for chroot(2).

Privilege check matches. Thanks for adding that.

Issue: pwd_altroot no-op leaks newpwd. Alloc is unconditional; when altroot_vp == oldpwd->pwd_adir the else nullifies oldpwd and the unused newpwd is never dropped.

Fixed, thanks.

Sat, Sep 26, 11:17 PM
kib accepted D60027: imgact_aout: Widen the overflow check in exec_aout_imgact().
Sat, Sep 26, 7:25 PM
kib updated the diff for D60047: sysarch.x86.2: manual page for the sysarch(2) functions on x86.

Fix typos and systematically markup instructions with .Dv.

Sat, Sep 26, 7:02 PM
kib added inline comments to D59930: nmount: Introduce the "onto_fsid" option.
Sat, Sep 26, 6:40 PM
kib updated the diff for D60047: sysarch.x86.2: manual page for the sysarch(2) functions on x86.

Suggested editing.

Sat, Sep 26, 4:56 PM
kib added inline comments to D60047: sysarch.x86.2: manual page for the sysarch(2) functions on x86.
Sat, Sep 26, 4:56 PM
kib updated the diff for D60035: chaltroot(2).

Extract chroot_unpriv() from kern_chroot.
Use the same privilege checks for chaltroot(2) as for chroot(2).

Sat, Sep 26, 4:39 PM
kib added a comment to D60035: chaltroot(2).

Yes, expose it. D59990 can configure the overlay from a native process, dropping the linux_base skip.

Sat, Sep 26, 4:38 PM
kib accepted D59990: tests/sys/vfs: add ABI-root absolute symlink tests.
Sat, Sep 26, 4:33 PM
kib requested review of D60047: sysarch.x86.2: manual page for the sysarch(2) functions on x86.
Sat, Sep 26, 3:13 PM
kib accepted D60023: amd64: gate WRMSRNS immediate form on compiler support.
Sat, Sep 26, 11:40 AM
kib added a comment to D58851: vm_object_take_pages_for_io(9).
In D58851#1377388, @kib wrote:

"pgrbwt" means that the function waits for the page busy state to pass. Often the reason for this state waiting forever is that the thread that waits already owns the busy state on the page.

Does the hang occur in the buffer strategy method?

Yes. Btw, I think the main use for this helper is in the server
where the vnode won't be an NFS one, so if this isn't easily
avoided, I wouldn't worry about it. (In other words, use the
helper in the NFS server, but not the NFS client.)

Sat, Sep 26, 10:51 AM
kib added inline comments to D59930: nmount: Introduce the "onto_fsid" option.
Sat, Sep 26, 9:43 AM
kib added a comment to D58851: vm_object_take_pages_for_io(9).

"pgrbwt" means that the function waits for the page busy state to pass. Often the reason for this state waiting forever is that the thread that waits already owns the busy state on the page.

Sat, Sep 26, 2:42 AM

Fri, Sep 25

kib added a comment to D60035: chaltroot(2).

This is a proposal for now, I want to discuss do we want this feature exposed to the native processes at all.
I thought about putting it under e.g. procctl(2), but it seems to not be a natural place.

Fri, Sep 25, 11:59 PM
kib requested review of D60035: chaltroot(2).
Fri, Sep 25, 11:56 PM
kib added inline comments to D59988: sched: New scheduler interface definition and implementation scheme.
Fri, Sep 25, 9:59 PM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

There is no bug that you claim. Behavior for normal lookup and and for operations directly on the inode number (AKA fh) have to differ because of their nature, where one operates over the global file namespace, and another acts on the inode identifiers within single filesystem.

Fri, Sep 25, 9:48 PM
kib updated the diff for D59996: libc/stdlib/getenv.c: always allocate new environment.

Always allocate new environment instead of checking it for NULL.

Fri, Sep 25, 8:09 PM
kib added a comment to D60022: cuse: Implement hot-unload.

We have d_purge cdevsw method. It is invoked by destroy_dev(9) when it observes threads inside cdevsw methods, to release the sleep. Would it be useful for your purpose there?

Fri, Sep 25, 7:51 PM
kib added inline comments to D59872: cuse: Improve server cleanup.
Fri, Sep 25, 7:49 PM
kib added inline comments to D59930: nmount: Introduce the "onto_fsid" option.
Fri, Sep 25, 6:53 PM
kib accepted D60024: uio: make *copyinuio take a void *.
Fri, Sep 25, 6:46 PM
kib accepted D60027: imgact_aout: Widen the overflow check in exec_aout_imgact().
Fri, Sep 25, 6:32 PM
kib added a comment to D60023: amd64: gate WRMSRNS immediate form on compiler support.

I suggest to do always define wrmsr_imm in the cpufunc.h header, but reduce it to wrmsr() if the compiler is too old. Then the calling sites do not need to care about compiler. It would generate pointless ifunc resolvers, but I do not think we should care.

Fri, Sep 25, 5:59 PM
kib added inline comments to D59894: libsys: add LoongArch support.
Fri, Sep 25, 9:55 AM
kib accepted D59865: arm64 pmap: Avoid redundant icache synchronization using PGA_EXECUTABLE.
Fri, Sep 25, 6:14 AM
kib added inline comments to D59894: libsys: add LoongArch support.
Fri, Sep 25, 6:03 AM
kib accepted D59995: vm_page: Replace PGA_EXECUTABLE with PGA_MACHDEP0004.
Fri, Sep 25, 4:02 AM
kib added a comment to D59990: tests/sys/vfs: add ABI-root absolute symlink tests.

I did not read the details of the tests, but I do not see a reason not to commit them now.

Fri, Sep 25, 3:47 AM
kib added inline comments to D59988: sched: New scheduler interface definition and implementation scheme.
Fri, Sep 25, 3:43 AM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.
In D59910#1376490, @kib wrote:

What do you mean by inconsistency? Do you want _MNTPOINT when fhstat("/")?

EDIT: No, that would be one more special case, and at the moment I don't see why we would want to treat / differently than any other path. Worse, doing so would introduce a discrepancy with stat("/") in jails with respect to the host for jails rooted in a filesystem's root that is not the host's /.

The inconsistency is this:

  1. Mount something on, let's say, /mnt (and possibly mount more filesystems on top of it, that doesn't change what's next).
  2. Do stat("/mnt"), this returns SFBSD_MNTPOINT.
  3. Do fhget("/mnt") and then fhstat() on the result, and SFBSD_MNTPOINT is not returned.

This is a problem because we naturally expect that 2 and 3 would give the same result,

Fri, Sep 25, 3:34 AM

Thu, Sep 24

kib updated the diff for D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

Report SFBSD_MNTPOINT for root on fhstat()

Thu, Sep 24, 6:51 PM
kib committed rGe40c72c823c6: VFS: style (authored by kib).
VFS: style
Thu, Sep 24, 6:40 PM
kib committed rG30ad8440b468: VFS: require locked vnode for fsync() (authored by kib).
VFS: require locked vnode for fsync()
Thu, Sep 24, 6:40 PM
kib committed rG53edaad235c8: filesystems: use g_vfs_close_unlocked(9) (authored by kib).
filesystems: use g_vfs_close_unlocked(9)
Thu, Sep 24, 6:40 PM
kib committed rG87962e08fa18: g_vfs_close_unlocked(9): wrapper around g_vfs_close(9) (authored by kib).
g_vfs_close_unlocked(9): wrapper around g_vfs_close(9)
Thu, Sep 24, 6:40 PM
kib closed D59932: VOP_FSYNC(): always require the locked vnode.
Thu, Sep 24, 6:39 PM
kib requested review of D59996: libc/stdlib/getenv.c: always allocate new environment.
Thu, Sep 24, 6:37 PM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

What do you mean by inconsistency? Do you want _MNTPOINT when stat("/")?

Thu, Sep 24, 5:45 PM
kib accepted D59995: vm_page: Replace PGA_EXECUTABLE with PGA_MACHDEP0004.

I would not encode the bit position in the name, for instance how it was done for OBJ_PAGEPRIV1/2.

Thu, Sep 24, 5:44 PM
kib updated the diff for D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

s/MNTROOT/MNTPOINT/g

Thu, Sep 24, 4:40 PM
kib added inline comments to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.
Thu, Sep 24, 4:40 PM
kib accepted D59982: lockf: Do not block in vfs_busy().
Thu, Sep 24, 4:13 PM
kib added a comment to D59932: VOP_FSYNC(): always require the locked vnode.

Does bufbdflush() need to be updated? I am not sure if it is ever called with a devvp.

Thu, Sep 24, 3:59 PM
kib updated the diff for D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

Reword

Thu, Sep 24, 10:36 AM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.
In D59910#1376112, @kib wrote:

The check on VIRF_MOUNTPOINT is indeed necessary if the handle points to an underlying vnode, but the check on VV_ROOT should be performed also, if for anything for consistency with fstatat().

No, VV_ROOT vnode is not a mountpoint when it is instantiated by ino number, instead of lookup. It is below mountpoint.

That's certainly true strictly speaking, but was not my point.

I think this can cause confusion to users obtaining first a handle and then calling fhstat() versus calling stat() because they would be inconsistent if both are performed after the mount operation has taken place.

It may well be better to change the semantics to: Reports a mount point or a filesystem root, which would avoid the inconsistency (and corresponds to checking VV_ROOT also).

Thu, Sep 24, 10:34 AM
kib updated the diff for D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

Clarification for fhstat(2).

Thu, Sep 24, 9:55 AM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

The check on VIRF_MOUNTPOINT is indeed necessary if the handle points to an underlying vnode, but the check on VV_ROOT should be performed also, if for anything for consistency with fstatat().

Thu, Sep 24, 9:48 AM

Wed, Sep 23

kib updated the diff for D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

Handle fhstat(2)

Wed, Sep 23, 10:20 PM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

Should kern_fhstat() be updated too?

Wed, Sep 23, 10:10 PM
kib added inline comments to D59930: nmount: Introduce the "onto_fsid" option.
Wed, Sep 23, 8:50 PM
kib updated the diff for D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

Drop nullfs specialization.

Wed, Sep 23, 8:41 PM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.
In D59910#1375621, @kib wrote:

If you really want to, use stat("/").

This might not work in a chroot or jail.

Wed, Sep 23, 8:39 PM
kib accepted D59929: libutil: Make free_iovec() set iovlen to zero, like the manpage says.
Wed, Sep 23, 7:15 PM
kib added a comment to D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag.

P.S. Perhaps bump __FreeBSD_version? Since there is no other way to probe if the kernel supports this feature or not.

Wed, Sep 23, 7:14 PM
kib added a comment to D59356: ffs: revalidate mkdir dependencies after vnode lookup.

@pho I tried to coerce ChatGPT Codex to write a reproducer, but it keep refusing claiming that's a security concern. I will try maybe to rephrase it as writing a "unit test to validate the fix."

Wed, Sep 23, 6:58 PM · Contributor Reviews (src)