Page MenuHomeFreeBSD

avg (Andriy Gapon)
User

Projects

User Details

User Since
Jun 4 2014, 6:42 AM (590 w, 4 d)

Recent Activity

Thu, Sep 25

avg accepted D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.
Thu, Sep 25, 1:53 PM
avg added inline comments to D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.
Thu, Sep 25, 1:53 PM
avg added a comment to D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.

If this looks ok, I'll extend it to support PCPU and DPCPU variables. And probably counter(9) too.

Thu, Sep 25, 1:40 PM

Mon, Sep 15

avg added a comment to D52492: net80211: log possible "ghost beacons" during a scan.

I never really worked with code in this area, but the change looks good to me.

Mon, Sep 15, 1:50 PM

Wed, Sep 10

avg added a comment to D52466: cpuctl: run amd_ucode_wrmsr only on one CPU and report if it failed.
In D52466#1198185, @kib wrote:

I somewhat doubt that the arguments by @avg were true.

Wed, Sep 10, 2:08 PM

Aug 26 2025

avg added inline comments to D51588: amdgpio: Mask and service interrupts.
Aug 26 2025, 5:28 AM

Aug 21 2025

avg accepted D52055: dtrace: Use a size_t to represent a buffer size in the printm action.

Maybe we can even retire printm...
I never knew it existed.

Aug 21 2025, 5:32 AM

Aug 9 2025

avg committed rG6b5813daf388: sys/geom: use proper style for sizeof operator (authored by avg).
sys/geom: use proper style for sizeof operator
Aug 9 2025, 11:32 AM
avg committed rG25a559444bd4: sys/geom: use proper style for sizeof operator (authored by avg).
sys/geom: use proper style for sizeof operator
Aug 9 2025, 11:30 AM

Aug 6 2025

avg committed rGaadc10e7ce1a: cam_fill_mmcio: initialize cmd.error sub-field (authored by avg).
cam_fill_mmcio: initialize cmd.error sub-field
Aug 6 2025, 6:05 AM
avg committed rG706291eddb45: mmc_da: garbage-collect sdda_get_max_data (authored by avg).
mmc_da: garbage-collect sdda_get_max_data
Aug 6 2025, 6:05 AM
avg committed rG7293d8210412: mmc_da: fix garbage in disk->d_attachment (authored by avg).
mmc_da: fix garbage in disk->d_attachment
Aug 6 2025, 6:05 AM
avg committed rGbe941fa4830f: mmc_xpt: use strlcpy instead of strncpy (authored by avg).
mmc_xpt: use strlcpy instead of strncpy
Aug 6 2025, 6:05 AM
avg committed rG48bd13dbf900: cam_fill_mmcio: initialize cmd.error sub-field (authored by avg).
cam_fill_mmcio: initialize cmd.error sub-field
Aug 6 2025, 6:03 AM
avg committed rGd4d7b768bb8e: mmc_da: garbage-collect sdda_get_max_data (authored by avg).
mmc_da: garbage-collect sdda_get_max_data
Aug 6 2025, 6:03 AM
avg committed rG9d5d9e723c4a: mmc_da: fix garbage in disk->d_attachment (authored by avg).
mmc_da: fix garbage in disk->d_attachment
Aug 6 2025, 6:03 AM
avg committed rGb91babab9596: mmc_xpt: use strlcpy instead of strncpy (authored by avg).
mmc_xpt: use strlcpy instead of strncpy
Aug 6 2025, 6:02 AM
avg committed rGab8d88442fbb: rk3328_codec: add trivial set_sysclk method implementation (authored by avg).
rk3328_codec: add trivial set_sysclk method implementation
Aug 6 2025, 6:02 AM
avg committed rGf8f0cae5e06b: rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP (authored by avg).
rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP
Aug 6 2025, 5:56 AM
avg committed rGe71f019b82f4: rk_i2c: emulate repeated start (authored by avg).
rk_i2c: emulate repeated start
Aug 6 2025, 5:56 AM
avg committed rG775224f7e412: rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP (authored by avg).
rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP
Aug 6 2025, 5:55 AM
avg committed rG640979856fc8: rk_i2c: emulate repeated start (authored by avg).
rk_i2c: emulate repeated start
Aug 6 2025, 5:55 AM

Aug 5 2025

avg committed rG6eb503116e88: sdio: don't use CAM_PRIORITY_NONE for queued CCB-s (authored by avg).
sdio: don't use CAM_PRIORITY_NONE for queued CCB-s
Aug 5 2025, 4:29 PM

Jul 26 2025

avg committed rG150834f8fa57: sys/geom: use proper style for sizeof operator (authored by avg).
sys/geom: use proper style for sizeof operator
Jul 26 2025, 3:23 PM

Jul 25 2025

avg accepted D51523: memchr.3: Operates on objects, not strings.

Thank you!

Jul 25 2025, 1:37 PM

Jul 24 2025

avg accepted D51480: bhyve: Report SVM as disabled on AMD.
Jul 24 2025, 1:20 PM

Jul 19 2025

avg accepted D51417: libdtrace: Permit taking the address of an identifier without type info.

LGTM

Jul 19 2025, 7:27 AM

Jul 7 2025

avg added a comment to D51188: dtrace: fix symbol address resolving.

@zldrobit_gmail.com if you cannot submit the change for review from Git (e.g., using git-arc), can you update it with a diff created with -U999 option?

Jul 7 2025, 1:03 PM · DTrace
avg committed R11:b627aaf6d6f6: sysutils/superiotool: fix build after pci after libpci 3.14.0 update (authored by avg).
sysutils/superiotool: fix build after pci after libpci 3.14.0 update
Jul 7 2025, 7:21 AM

Jul 4 2025

avg committed rGad0c3859a918: mmc_da: garbage-collect sdda_get_max_data (authored by avg).
mmc_da: garbage-collect sdda_get_max_data
Jul 4 2025, 8:08 AM

Jul 3 2025

avg committed R11:72eb9c02573a: check_have_symbols.sh: remove pipefail shell option (authored by avg).
check_have_symbols.sh: remove pipefail shell option
Jul 3 2025, 3:52 PM

Jul 2 2025

avg committed R11:a6a666b6946d: sysutils/superiotool: fix build after pci after libpci 3.14.0 update (authored by avg).
sysutils/superiotool: fix build after pci after libpci 3.14.0 update
Jul 2 2025, 7:54 AM

Jun 27 2025

avg committed rG264aeb32e9ee: ads111x: initialize the lock earlier, before it's used (authored by avg).
ads111x: initialize the lock earlier, before it's used
Jun 27 2025, 7:44 AM
avg committed rG4d1ff6d22ba7: dwc_otg_fdt: do not create and leak extra usbus child (authored by avg).
dwc_otg_fdt: do not create and leak extra usbus child
Jun 27 2025, 7:44 AM
avg committed rG0bcd8425f055: OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM (authored by avg).
OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM
Jun 27 2025, 7:44 AM
avg committed rGce773fbaec9b: rk_i2s: correct some bit-field definitions, add more bits (authored by avg).
rk_i2s: correct some bit-field definitions, add more bits
Jun 27 2025, 7:40 AM
avg committed rGec88c4841385: ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush (authored by avg).
ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush
Jun 27 2025, 7:40 AM
avg committed rGb4e40a47d379: ads111x: initialize the lock earlier, before it's used (authored by avg).
ads111x: initialize the lock earlier, before it's used
Jun 27 2025, 7:40 AM
avg committed rG19fdd9fd613d: dwc_otg_fdt: do not create and leak extra usbus child (authored by avg).
dwc_otg_fdt: do not create and leak extra usbus child
Jun 27 2025, 7:40 AM
avg committed rG17ee60307cc9: OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM (authored by avg).
OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM
Jun 27 2025, 7:40 AM
avg committed rG5aedb8b1d4a6: mmc_da: fix garbage in disk->d_attachment (authored by avg).
mmc_da: fix garbage in disk->d_attachment
Jun 27 2025, 7:23 AM
avg committed rGad8d33679999: mmc_xpt: use strlcpy instead of strncpy (authored by avg).
mmc_xpt: use strlcpy instead of strncpy
Jun 27 2025, 7:23 AM
avg committed rG99f436aec00e: rk3328_codec: add trivial set_sysclk method implementation (authored by avg).
rk3328_codec: add trivial set_sysclk method implementation
Jun 27 2025, 7:23 AM
avg committed rG10db2ad8614a: cam_fill_mmcio: initialize cmd.error sub-field (authored by avg).
cam_fill_mmcio: initialize cmd.error sub-field
Jun 27 2025, 7:23 AM

Jun 23 2025

avg committed R11:1fc26d9baa11: sysutils/memtest86+: deprecate the port and set expiration date (authored by avg).
sysutils/memtest86+: deprecate the port and set expiration date
Jun 23 2025, 9:45 AM

Jun 20 2025

avg added a comment to D26407: [PREVIEW] support for gpio interrupts on !intrng platforms.

Here is an example of how I made use of this code in iichid when it still was out-of-tree:
https://github.com/avg-I/iichid/commit/d5c33b243c599fd234685a2cd8ee1bd1fb67e1b0

Jun 20 2025, 2:06 PM

May 20 2025

avg committed rG0d2fd5b99c95: ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush (authored by avg).
ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush
May 20 2025, 2:57 PM

May 19 2025

avg committed rG28d74f18f1c2: OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM (authored by avg).
OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM
May 19 2025, 9:30 AM
avg committed rG3fc4ddb0151d: rk_i2s: correct some bit-field definitions, add more bits (authored by avg).
rk_i2s: correct some bit-field definitions, add more bits
May 19 2025, 9:20 AM
avg committed rGeda3a7ac755c: ads111x: initialize the lock earlier, before it's used (authored by avg).
ads111x: initialize the lock earlier, before it's used
May 19 2025, 9:16 AM
avg committed rG97c799661a76: dwc_otg_fdt: do not create and leak extra usbus child (authored by avg).
dwc_otg_fdt: do not create and leak extra usbus child
May 19 2025, 9:14 AM

May 14 2025

avg added a comment to D50338: vfs: vn_alloc(): Stop always calling vn_alloc_hard() and direct reclaiming.
In D50338#1148702, @avg wrote:

I pointed out this problem to Kirk and Colin back when the change was made.
I had to do the same kind of fix locally (for Panzura) because of live-locks as well.

I should probably have contacted you when I saw the revert commit, as even if I hadn't suspected there was a problem with it and hadn't experienced deadlocks yet, I was interested in the vnode cache and had analyzed quite a bunch of it at that time already.

That said, it would have been nice that Kirk and Colin put the revert under review (I suspect they didn't in part because they were running out of time) so that your "objection" could be logged. Were there any specific problems preventing you from submitting your local fix, or just lack of time?

Anyway, we are now at risk of shipping 14.3 with this annoying bug (although I don't know its frequency in general; all I can say is that, for my use case, it's becoming super annoying). I hope the fix here will be included in 14.3. Will normally have finished my tests in a couple of hours (now with the reload of numvnodes), and will report here.

May 14 2025, 3:11 PM
avg added a comment to D50338: vfs: vn_alloc(): Stop always calling vn_alloc_hard() and direct reclaiming.

Thank you very much!

May 14 2025, 1:24 PM
avg accepted D50338: vfs: vn_alloc(): Stop always calling vn_alloc_hard() and direct reclaiming.
May 14 2025, 1:24 PM
avg added inline comments to D50338: vfs: vn_alloc(): Stop always calling vn_alloc_hard() and direct reclaiming.
May 14 2025, 10:40 AM
avg added a comment to D50338: vfs: vn_alloc(): Stop always calling vn_alloc_hard() and direct reclaiming.

I pointed out this problem to Kirk and Colin back when the change was made.
I had to do the same kind of fix locally (for Panzura) because of live-locks as well.
But I have one small difference, not sure if important, which I'll describe in an inline comment.

May 14 2025, 10:36 AM

Apr 18 2025

avg accepted D49886: Fix build with WITH_CLANG_BOOTSTRAP and WITHOUT_CLANG.

Thank you!

Apr 18 2025, 1:32 PM

Mar 7 2025

avg accepted D49129: acpi_wmi: Add type check before evaluaeting query ACPI method.

Looks good to me.

Mar 7 2025, 1:29 PM
avg added inline comments to D49129: acpi_wmi: Add type check before evaluaeting query ACPI method.
Mar 7 2025, 1:29 PM

Feb 21 2025

avg committed R11:d0cf6f344404: science/pulseview: fix crash on startup when libcxx has asserts enabled (authored by avg).
science/pulseview: fix crash on startup when libcxx has asserts enabled
Feb 21 2025, 6:07 AM
avg added a reverting change for R11:338914f96f72: science/pulseview: mark as BROKEN with Boost>=1.87 (+): R11:9ada3310f782: science/pulseview: unbreak the build.
Feb 21 2025, 6:07 AM
avg committed R11:9ada3310f782: science/pulseview: unbreak the build (authored by avg).
science/pulseview: unbreak the build
Feb 21 2025, 6:07 AM

Feb 7 2025

avg resigned from D48874: swapon: parse md.eli device for encrypted swapfile from fstab.
Feb 7 2025, 1:01 PM
avg added a comment to D48881: WIP: sysctl: Respect max length when treat a variable string as a constant string.

Still looks good to me.

Feb 7 2025, 12:59 PM
avg accepted D48881: WIP: sysctl: Respect max length when treat a variable string as a constant string.
Feb 7 2025, 12:59 PM

Feb 6 2025

avg added inline comments to D48511: sysctl: Harden sysctl_handle_string() against unterminated strings.
Feb 6 2025, 8:50 AM

Feb 5 2025

avg added a comment to D48511: sysctl: Harden sysctl_handle_string() against unterminated strings.

The change looks good to me.
Thank you.

Feb 5 2025, 9:47 AM

Jan 14 2025

avg added a comment to D43712: vmxnet3: make descriptor count checks more robust.

I think that vmxnet3_isc_txd_credits_update can be made similar to, e.g., igb_isc_txd_credits_update with respect to the array index (tx_rs_cidx and vxcr_next respectively).
That is, we can stash vxcr_next into a local variable and then use the local variable for iteration.
At the end, we can update vxcr_next from the local variable.
This won't fix other potential issues with correctness / concurrency (data races), but at least it will ensure that vxcr_next will not have an out-of-bounds value.

Jan 14 2025, 11:24 AM
avg added inline comments to D43712: vmxnet3: make descriptor count checks more robust.
Jan 14 2025, 10:43 AM

Jan 10 2025

avg added a comment to D48283: ithread: Allow some ithreads to sleep.

@jhb my personal / private interest in sleepable ithreads is "natural" support for interrupt controllers on slow buses.
Originally, it was assumed that an interrupt controller has fast access and they had.
But imagine something like an I/O expander on an I2C bus.
Let's assume that it supports detecting changes on its I/O inputs and also has a dedicated line to an upstream interrupt controller.
We can configure interrupt modes using I2C transactions and we can also query / mask / etc interrupt lines using I2C.
This is a real interrupt controller from all points of view and if we want to avoid polling (for potentially long time) we need to support sleeping / waiting while communicating with such controller.
At least, that's how I see it.

Jan 10 2025, 5:07 PM

Jan 2 2025

avg added inline comments to D48283: ithread: Allow some ithreads to sleep.
Jan 2 2025, 5:03 PM

Nov 27 2024

avg added inline comments to D47780: sound: Do not access cv_waiters.
Nov 27 2024, 6:38 PM
avg added inline comments to D47780: sound: Do not access cv_waiters.
Nov 27 2024, 6:13 PM
avg accepted D47780: sound: Do not access cv_waiters.

Looks goof to me.
Thank you!

Nov 27 2024, 6:11 PM
avg added a comment to D47779: condvar: Add cv_waiters() macro.

I guess the same is true for PCM_RELEASE.

Nov 27 2024, 3:53 PM
avg added a comment to D47779: condvar: Add cv_waiters() macro.

Alright. There are other places in the sound driver that cv_waiters is still accessed directly, so I will see how I can fix those as well.

Nov 27 2024, 3:48 PM
avg added a comment to D47779: condvar: Add cv_waiters() macro.

Is there a reason (except maybe layering violations) that we do not want to do it this way and it's better to implement an additional counter in the driver?

Nov 27 2024, 3:43 PM
avg added a comment to D47779: condvar: Add cv_waiters() macro.

Also, cv_wmesg is kind of semi-private and it's used only for diagnostics (tracing).
So, I don't think that it's precedent for general access to cv implementation details.

Nov 27 2024, 3:40 PM
avg added a comment to D47779: condvar: Add cv_waiters() macro.

As I noted in the email thread, there is only one consumer outside of condvar implementation.

Nov 27 2024, 3:37 PM

Nov 15 2024

avg committed R11:71a3e9d15a4e: sysutils/i2c-tools: update to 4.3 (authored by avg).
sysutils/i2c-tools: update to 4.3
Nov 15 2024, 2:33 PM

Nov 14 2024

avg added a comment to D47571: Add support for Nuvoton NCT6122D/NCT6126D..
In D47571#1084984, @avg wrote:

If you have added this from a diff, could you please re-do the diff with -U 9999 option?
That's to have a lot more context lines which would be useful when reviewing.

Done.

Nov 14 2024, 4:49 PM
avg added a comment to D47571: Add support for Nuvoton NCT6122D/NCT6126D..

If you have added this from a diff, could you please re-do the diff with -U 9999 option?
That's to have a lot more context lines which would be useful when reviewing.

Nov 14 2024, 4:23 PM

Nov 1 2024

avg added inline comments to D47253: GPIO: Add ACPI _AEI support.
Nov 1 2024, 3:04 PM
avg added inline comments to D47253: GPIO: Add ACPI _AEI support.
Nov 1 2024, 2:59 PM

Oct 12 2024

avg committed R9:20cf32ba3dc3: pgpkeys: update my (avg) key (authored by avg).
pgpkeys: update my (avg) key
Oct 12 2024, 10:00 PM

Oct 5 2024

avg accepted D46421: x86: Refactor kernel-mode NMI handling .
Oct 5 2024, 6:44 PM

Sep 25 2024

avg added a comment to D46421: x86: Refactor kernel-mode NMI handling .

Oh, thinking about this triggered some old memories and I've dug up my old musings on this topic.
The code was never really tested and I cannot guarantee that it's correct, but it seemed correct to the younger me and it still seems correct the now me.
https://people.freebsd.org/~avg/wfhandler.v8.h

Sep 25 2024, 8:43 PM
avg added a comment to D46421: x86: Refactor kernel-mode NMI handling .
In D46421#1066706, @avg wrote:

Another general suggestion is that using CK_SLIST from ConcurrencyKit (included into FreeBSD) might help to make the code more compact and expressive.
But I haven't thought through details, so please feel free to ignore this suggestion if CK does not provide something that could be readily used.
The proposed code is completely good too.

Sep 25 2024, 8:32 PM
avg accepted D46421: x86: Refactor kernel-mode NMI handling .

Another general suggestion is that using CK_SLIST from ConcurrencyKit (included into FreeBSD) might help to make the code more compact and expressive.
But I haven't thought through details, so please feel free to ignore this suggestion if CK does not provide something that could be readily used.
The proposed code is completely good too.

Sep 25 2024, 8:14 PM
avg added a comment to D39970: it8613hwm(4): Add new driver for ITE IT8613 hardware monitor.

I am not sure that such a OS/ACPI (firmware) mutex is possible.

Sep 25 2024, 5:11 AM

Sep 19 2024

avg added inline comments to D46421: x86: Refactor kernel-mode NMI handling .
Sep 19 2024, 12:54 PM
avg added a comment to D46421: x86: Refactor kernel-mode NMI handling .

My only concern with the current deregistration approach is a hypothetical situation where a handler resides in a loadable module and, thus, can be unloaded after deregistration.
I like the clever simplicity of the current code where list elements are never removed and only the head pointer can ever be modified.
But maybe it would be good for nmi_remove_handler to wait for a completion of the handler if it's running.
E.g., we could add an atomic counter to struct nmi_handler which would be incremented when the handler is started and decremented when the handler is done.
Then, nmi_remove_handler could spin-wait on that counter if it's not zero (after having cleared func field to prevent future calls).

Sep 19 2024, 12:51 PM

Sep 15 2024

avg accepted D46674: dtrace tests: Add a test case which validates FBT probe arguments.
Sep 15 2024, 8:10 PM
avg accepted D46673: dtrace_test: Remove the dependency on dtraceall.
Sep 15 2024, 9:10 AM
avg accepted D46674: dtrace tests: Add a test case which validates FBT probe arguments.

LGTM

Sep 15 2024, 9:09 AM
avg accepted D46675: dtrace/amd64: Remove the dtrace_invop_callsite symbol.
Sep 15 2024, 8:57 AM
avg accepted D46672: dtrace/amd64: Fix probe argument fetching.

I like how using t_dtrace_trapframe both eliminates the search for the frame below the trap frame and the assumption on the position of the trap frame.

Sep 15 2024, 8:55 AM

Aug 27 2024

avg added inline comments to D23378: sysctl(9): add CTLFLAG_NEEDGIANT flag.
Aug 27 2024, 3:21 PM

Aug 12 2024

avg added inline comments to D45179: mt7601U: Importing if_mtw from OpenBSD.
Aug 12 2024, 5:39 AM

Jun 27 2024

avg committed rGa743e280ea05: rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP (authored by avg).
rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP
Jun 27 2024, 10:33 AM