Page MenuHomeFreeBSD
Feed Advanced Search

Thu, Jan 2

markj updated the diff for D48263: vmm.4: Update to mention non-amd64 platforms.

Remove mention of the SSTC extension

Thu, Jan 2, 4:19 PM
markj updated the diff for D48269: vmm: Fix error handling in vmm_handler().

Fix error return

Thu, Jan 2, 4:16 PM
markj added a comment to D48265: ipsec: improve integration with unmapped mbufs (on Tx).

Fetch the IP header using m_copydata() instead of using mtod() to select policy/SA.

Thu, Jan 2, 3:03 PM
markj accepted D48284: acpi: Mark the GED ithread as sleepable.
Thu, Jan 2, 1:58 PM
markj added inline comments to D48283: ithread: Allow some ithreads to sleep.
Thu, Jan 2, 1:58 PM
markj added a reviewer for D48283: ithread: Allow some ithreads to sleep: jhb.
Thu, Jan 2, 1:58 PM

Wed, Jan 1

markj accepted D48275: Fix lib/libc/nss/getgr_test with large numbers of groups.

This looks like it does what it's supposed to do.

Wed, Jan 1, 4:01 PM
markj committed rG4196f227aa84: libdtrace: Be less strict when comparing pointer types (authored by markj).
libdtrace: Be less strict when comparing pointer types
Wed, Jan 1, 12:05 AM
markj closed D48254: libdtrace: Be less strict when comparing pointer types.
Wed, Jan 1, 12:05 AM

Tue, Dec 31

markj added a comment to D48265: ipsec: improve integration with unmapped mbufs (on Tx).
In D48265#1100756, @kib wrote:

I wonder why exactly software ipsec cannot process unmapped mbufs. In an unmapped ktls packet, the protocol headers are still mapped. netipsec needs to access the payload in order to encrypt, but it uses opencrypto's cursor abstraction, and crypto_cursor_* handles unmapped mbufs. What is missing?

Basically, I wonder if we can side-step the problem by making netipsec compatible with unmapped mbufs.

Well, it started with PR 272616. There m_unshare uses memcpy() not being adopted for the unmapped buffers.

I think my patch moves the code in the right direction, and is the useful first step. For now, it avoids the cost of re-mapping incurred for all packets just if ipsec.ko is loaded. Also, it:

  • handles incompatibility/panic/UB between ipsec and ktls
  • should improve offloaded ipsec because packets are kept unmapped there.
Tue, Dec 31, 8:44 PM
markj added a comment to D48265: ipsec: improve integration with unmapped mbufs (on Tx).

I wonder why exactly software ipsec cannot process unmapped mbufs. In an unmapped ktls packet, the protocol headers are still mapped. netipsec needs to access the payload in order to encrypt, but it uses opencrypto's cursor abstraction, and crypto_cursor_* handles unmapped mbufs. What is missing?

Tue, Dec 31, 4:28 PM
markj requested review of D48270: vmm: Consolidate code which manages guest memory regions.
Tue, Dec 31, 3:37 PM
markj requested review of D48269: vmm: Fix error handling in vmm_handler().
Tue, Dec 31, 3:37 PM
markj requested review of D48268: amd64/vmm: Rename vm_get_vmspace() to vm_vmspace().
Tue, Dec 31, 3:37 PM
markj requested review of D48267: amd64/vmm: Remove vmm_mem_init().
Tue, Dec 31, 3:37 PM

Mon, Dec 30

markj requested review of D48263: vmm.4: Update to mention non-amd64 platforms.
Mon, Dec 30, 9:55 PM
markj added a comment to D48241: usr.sbin/bhyve: add rendezvous layer for initialization step of bhyve.

Another consumer of rendezvous will be the raw socket over serial console that I have implemented a couple months ago. I haven't implement the wait operation on raw socket serial console. I would like to confirm the interface of rendezvous before I implement it.

Mon, Dec 30, 7:30 PM
markj added a comment to D48254: libdtrace: Be less strict when comparing pointer types.

Don't have expertise to review, but thanks a lot for working on that. Was following your discussion with Dmitry. I hit this problem many many times, when running a different mix of modules on FreeBSD CURRENT and never bothered to understand it. Always resorted to recompile a static kernel.

Mon, Dec 30, 5:58 PM
markj updated the diff for D48254: libdtrace: Be less strict when comparing pointer types.

Only compare names if we have them.

Mon, Dec 30, 5:46 PM
markj requested review of D48254: libdtrace: Be less strict when comparing pointer types.
Mon, Dec 30, 5:43 PM
markj added a comment to D48251: makefs: Fix cd9660 duplicate directory names.

Any chance you could turn this into a regression test case?

I've been looking at makefs regression tests, in particular as a prerequisite for a more holistic rewrite of makefs's cd9660 pathname logic. The approach taken by the existing tests isn't great for these sorts of tests (it mounts the created image and relies on the kernel's iso9660 support). We could add tests that require cdrtools to be present, but my (longer-term) preference is to add a (probably lua-based) iso9660 dumper.

Mon, Dec 30, 3:48 PM
markj added a comment to D48251: makefs: Fix cd9660 duplicate directory names.

Example from PR283238:

$ mkdir -p test9660/this-is-a-directory-with-a-long-common-prefix-1 test9660/this-is-a-directory-with-a-long-common-prefix-2
$ makefs -t cd9660 -o rockridge test.iso test9660/
$ isoinfo -p -i test.iso
Setting input-charset to 'UTF-8' from locale.
Path table starts at block 18, size 86
   1:    1 14 
   2:    1 15 THIS_IS_A_DIRECTORY_WITH_A_LON
   3:    1 16 THIS_IS_A_DIRECTORY_WITH_A_LON

With this:

$ isoinfo -p -i test.iso
Setting input-charset to 'UTF-8' from locale.
Path table starts at block 18, size 90
   1:    1 14 
   2:    1 15 THIS_IS_A_DIRECTORY_WITH_A_LON0
   3:    1 16 THIS_IS_A_DIRECTORY_WITH_A_LONG
Mon, Dec 30, 3:31 PM
markj added a comment to D48241: usr.sbin/bhyve: add rendezvous layer for initialization step of bhyve.

Are there any other potential consumers of this interface, besides rfb? I see the comment that mentions why gdb can't participate, which is a bit unsatisfying but okay.

Mon, Dec 30, 3:20 PM
markj updated the diff for D48222: syslogd: Ensure that forwarded messages are sent from port 514.

Handle the possibility of duplicate forwarding addresses.

Mon, Dec 30, 3:08 PM
markj added a comment to D48032: sound: Remove macro magic from pcm/feeder_eq.c.

If you want to make your function equal to the macro in terms of performance, you have to call it with literal format parameters somehow. E.g. through a switch on the format parameters.

I do not have a benchmark right now to prove the opposite, but do you think such a performance hit is noticeable, if at all existent? Currently we use a function pointer to a specialized function (i.e one for each format), and the patch uses a generic function which fetches the format directly from the struct. I am not really well-versed with compiler optimizations, but I would suppose that the generic one is more likely to be inlined, and thus give us a performance boost (I did see the comment about CPU-branch prediction in D47932).

The function pointer prevents inlining, alright. But inlining your generic function doesn't help to optimize the inner loops in feed_eq_biquad() that dominate here. The macro did that.

The main rationale behind this patch, as well as the other similar ones, is to make the code cleaner and easier to work with. There had been a few times already where I tried to make some changes to these files (especially with AFMT_FLOAT support) and the macros make it quite tedious. Even though D47932 fixes most of what I wanted, I still think it's good to have clean code everywhere.

I'm not telling you to go back to macros. All you need is a switch on the format parameter, in a dispatch function between the caller and feed_eq_biquad(). Something like:

switch(info->fmt) {
/* Cases you want to optimize for. */
case AFMT_S16_NE:
        feed_eq_biquad(..., ..., ..., AFMT_S16_NE);
        break;
case AFMT_S32_NE:
        feed_eq_biquad(..., ..., ..., AFMT_S32_NE);
        break;
/* Generic fallback, less optimized. */
default:
        feed_eq_biquad(..., ..., ..., info->fmt);
        break;
}
Mon, Dec 30, 2:57 PM
markj requested review of D48250: syslogd: Fix resource leaks.
Mon, Dec 30, 2:07 PM

Sun, Dec 29

markj added inline comments to D48035: sound: Remove macro magic from pcm/feeder_matrix.c.
Sun, Dec 29, 8:34 PM
markj committed rG9ba7351fcfd7: ssp: Make ssp.h more self-contained (authored by markj).
ssp: Make ssp.h more self-contained
Sun, Dec 29, 5:59 PM
markj closed D48226: ssp: Include a header to provide __size_t.
Sun, Dec 29, 5:59 PM

Dec 28 2024

markj added inline comments to D48222: syslogd: Ensure that forwarded messages are sent from port 514.
Dec 28 2024, 9:30 PM
markj added inline comments to D48222: syslogd: Ensure that forwarded messages are sent from port 514.
Dec 28 2024, 8:44 PM
markj accepted D48197: tee: try opening as a UNIX socket if open(2) fails.
Dec 28 2024, 4:53 PM
markj accepted D48200: Several fixes for libthr, related to cancellation.
Dec 28 2024, 4:46 PM
markj requested review of D48226: ssp: Include a header to provide __size_t.
Dec 28 2024, 4:45 PM

Dec 27 2024

markj abandoned D48212: syslogd tests: Add some regression tests for -a with IPv4 addresses.
Dec 27 2024, 10:12 PM
markj requested review of D48222: syslogd: Ensure that forwarded messages are sent from port 514.
Dec 27 2024, 10:02 PM
markj requested review of D48212: syslogd tests: Add some regression tests for -a with IPv4 addresses.
Dec 27 2024, 4:14 PM

Dec 25 2024

markj accepted D48191: ntpd: Use the ntpd -u option in preference to the rc su plumbing.
Dec 25 2024, 5:41 PM
markj added inline comments to D48191: ntpd: Use the ntpd -u option in preference to the rc su plumbing.
Dec 25 2024, 5:41 PM
markj added inline comments to D48200: Several fixes for libthr, related to cancellation.
Dec 25 2024, 5:20 PM

Dec 24 2024

markj accepted D48186: amd64 EFI RT: provide fault data on call fault.
Dec 24 2024, 4:43 PM
markj added inline comments to D48192: bhyve: Implement the libslirp notify callback.
Dec 24 2024, 3:55 PM
markj added inline comments to D48186: amd64 EFI RT: provide fault data on call fault.
Dec 24 2024, 3:46 PM
markj added inline comments to D48191: ntpd: Use the ntpd -u option in preference to the rc su plumbing.
Dec 24 2024, 3:43 PM
markj requested review of D48192: bhyve: Implement the libslirp notify callback.
Dec 24 2024, 3:40 PM

Dec 23 2024

markj added inline comments to D48183: sound: Call vchan_destroy() on vchan_create() failure.
Dec 23 2024, 9:24 PM
markj added inline comments to D48183: sound: Call vchan_destroy() on vchan_create() failure.
Dec 23 2024, 9:13 PM
markj updated the test plan for D48182: busdma: Avoid overallocation of bounce pages.
Dec 23 2024, 9:07 PM
markj added inline comments to D47521: busdma: Avoid leaking bounce pages when destroy DMA tags.
Dec 23 2024, 9:06 PM
markj requested review of D48182: busdma: Avoid overallocation of bounce pages.
Dec 23 2024, 9:01 PM
markj committed rG5982237f1e5a: sed: Fix handling of an empty pattern space (authored by mohd.akram_outlook.com).
sed: Fix handling of an empty pattern space
Dec 23 2024, 7:14 PM
markj committed rG003818aca4cd: sed tests: Add a regression test for the c function (authored by markj).
sed tests: Add a regression test for the c function
Dec 23 2024, 7:14 PM
markj committed rG5c15d499c23a: Revert "ixl: fix multicast filters handling" (authored by franco_opnsense.org).
Revert "ixl: fix multicast filters handling"
Dec 23 2024, 4:53 PM
markj added a reverting change for rG89e73359424a: ixl: fix multicast filters handling: rG5c15d499c23a: Revert "ixl: fix multicast filters handling".
Dec 23 2024, 4:53 PM
markj committed rG2a6c77b343f6: linuxkpi: Fix a lock leak in lkpi_sta_scan_to_auth() (authored by markj).
linuxkpi: Fix a lock leak in lkpi_sta_scan_to_auth()
Dec 23 2024, 4:53 PM
markj committed rGae21b1f88e02: ipfw.d: Add required dependency declarations (authored by markj).
ipfw.d: Add required dependency declarations
Dec 23 2024, 4:53 PM
markj added a reverting change for D40860: ixl: fix multicast filters handling: rG5c15d499c23a: Revert "ixl: fix multicast filters handling".
Dec 23 2024, 4:53 PM
markj added a comment to D48163: ip: Defer checks for an unspecified dstaddr until after pfil hooks.

I thinks that is a general question, that is, does a firewall want to see all known invalid packets? For example, the above logic to check IN_LOOPBACK on the wire.

Dec 23 2024, 3:57 PM
markj committed rG66a022a30dd9: syslogd: Add syslog basic message format tests (authored by Michal Scigocki <michal.os@hotmail.com>).
syslogd: Add syslog basic message format tests
Dec 23 2024, 3:50 PM
markj committed rG65c61840eeb7: syslogd: Add syslog relayed message format tests (authored by Michal Scigocki <michal.os@hotmail.com>).
syslogd: Add syslog relayed message format tests
Dec 23 2024, 3:50 PM
markj committed rGee75c991acdc: syslogd: Add syslog forwarded message format tests (authored by Michal Scigocki <michal.os@hotmail.com>).
syslogd: Add syslog forwarded message format tests
Dec 23 2024, 3:50 PM
markj committed rG8cc248fb92bf: syslogd: Add rfc3164-strict format option (authored by Michal Scigocki <michal.os@hotmail.com>).
syslogd: Add rfc3164-strict format option
Dec 23 2024, 3:50 PM
markj committed rGaa94868f5e9a: syslogd: Remove is_exclusive metadata from tests (authored by Michal Scigocki <michal.os@hotmail.com>).
syslogd: Remove is_exclusive metadata from tests
Dec 23 2024, 3:50 PM
markj closed D47870: inpcb: Further restrict binding to a port owned by a different UID.
Dec 23 2024, 3:41 PM
markj committed rGc9756953bded: inpcb: Further restrict binding to a port owned by a different UID (authored by markj).
inpcb: Further restrict binding to a port owned by a different UID
Dec 23 2024, 3:41 PM
markj added inline comments to D47956: tmpfs: Rework file handles.
Dec 23 2024, 3:40 PM

Dec 21 2024

markj closed D47842: sysctl: Do not serialize requests when running as root.
Dec 21 2024, 7:28 PM
markj committed rG7d1d9cc440f8: sysctl: Do not serialize requests when running as root (authored by markj).
sysctl: Do not serialize requests when running as root
Dec 21 2024, 7:28 PM
markj committed rG8cf955f3f48a: jail: Handle jail removal in a dedicated thread (authored by markj).
jail: Handle jail removal in a dedicated thread
Dec 21 2024, 7:24 PM
markj closed D47991: jail: Handle jail removal in a dedicated thread.
Dec 21 2024, 7:24 PM
markj added a comment to D47842: sysctl: Do not serialize requests when running as root.
In D47842#1090897, @jhb wrote:

The thing that makes this a bit odd in terms of the memory limit is that userspace isn't the one requesting to wire the memory. The kernel does by calling sysctl_wire_old_buffer in an individual handler. It would be nice to be smarter about this, e.g. don't acquire the lock until sysctl_wire_old_buffer is actually called? OTOH, one might ask why we really need the lock at all? I guess the worry is that userspace can DOS the kernel by making lots of requests with large buffers for nodes that are known to use sysctl_wire_old_buffer?

Dec 21 2024, 7:20 PM
markj added a comment to D48163: ip: Defer checks for an unspecified dstaddr until after pfil hooks.

On second thought this probably needs to be mentioned in Relnotes and not MFC-ed. Cause it might be that somebody was relying on the stack to drop those packets before firewall.

Dec 21 2024, 6:59 PM
markj added a comment to D47807: WIP/RFC: another busdma fix for small bounce transfers.

I'm sorry for the delayed follow-up. I'm trying to understand the purpose of the roundup. It appears to have been introduced by commit daf6545e6158f; the implication seems to be that some drivers depend on the property that "the relative alignment of two consecutive bytes in the I/O stream have a difference of 1 even if they are not physically contiguous."

Dec 21 2024, 1:46 AM

Dec 20 2024

markj requested review of D48164: bhyve: Use a non-blocking read in slirp_recv().
Dec 20 2024, 5:19 PM
markj added a comment to D47953: pf: Force logging if pf_create_state() fails.

Improve the situation a bit: force logging if state creation fails.
This isn't totally right as we'll end up logging the packet twice in
this case, but it's better than not logging the drop at all.

This seems more like a workaround than a fix of underlying design issues. Since I'm responsible for the mess of pf_rule_actions and match rules, I might be able to propose an alternative solution. Can you wait a few days?

Dec 20 2024, 4:02 PM
markj requested review of D48163: ip: Defer checks for an unspecified dstaddr until after pfil hooks.
Dec 20 2024, 3:59 PM
markj accepted D48150: nullfs: stop lying about mount flags in statfs(2).
In D48150#1098165, @kib wrote:

Suppose a filesystem has MNT_NOSUID set, and contains a setuid root executable. If I create a nullfs mount of that filesystem and run the executable though nullfs, should the suid bit be honoured? I would expect not, but it is. In particular, MNT_NOSUID is not copied to the upper mount, and the code which checks MNT_NOSUID does not use a VOP, it just checks vp->v_mount->mnt_flags.

This is the current behavior, before or after the change, and in fact it is not that weird. Imagine that instead of nullfs, the lower fs is exported and mounted by nfs. The result is same.

Dec 20 2024, 3:28 PM
markj added a comment to D48150: nullfs: stop lying about mount flags in statfs(2).
In D48150#1098159, @kib wrote:

When lower fs acts according to its mount configuration, it is reported up as VOP errors.

I do not quite understand what you mean here.

I mean that mnt_flags from lower fs do not need to be propagated to upper fs to make the mount operate correctly. Lower fs flags are checked when bypass calls lower VOP. So there is no need to 'fake' mnt_flags for upper fs, and esp. to fake it for only reporting to user in statfs(2).

Dec 20 2024, 3:04 PM
markj added a comment to D48150: nullfs: stop lying about mount flags in statfs(2).

When lower fs acts according to its mount configuration, it is reported up as VOP errors.

Dec 20 2024, 1:51 PM

Dec 19 2024

markj committed rG38663adb6144: Revert "ixl: fix multicast filters handling" (authored by franco_opnsense.org).
Revert "ixl: fix multicast filters handling"
Dec 19 2024, 1:51 PM
markj added a reverting change for rG89e73359424a: ixl: fix multicast filters handling: rG38663adb6144: Revert "ixl: fix multicast filters handling".
Dec 19 2024, 1:50 PM
markj added a reverting change for D40860: ixl: fix multicast filters handling: rG38663adb6144: Revert "ixl: fix multicast filters handling".
Dec 19 2024, 1:50 PM
markj accepted D48139: exports.5: Document correct behaviour for -alldirs.

The current verbiage does need improvement.

Dec 19 2024, 1:36 PM
markj added a comment to D47706: safexel manuals: improve apropos and HW relnotes.

If you mail me git format-patch output or submit it on github, I'll apply it.

Dec 19 2024, 1:28 PM
markj accepted D47956: tmpfs: Rework file handles.
Dec 19 2024, 1:24 PM

Dec 18 2024

markj committed rG11c7eb30cc9b: pfkey: Fix some checks in kdebug_sadb() (authored by Tobias Heider <me@tobhe.me>).
pfkey: Fix some checks in kdebug_sadb()
Dec 18 2024, 2:16 PM
markj committed rG9daf6d641922: shm: Handle swap pager allocation failures (authored by markj).
shm: Handle swap pager allocation failures
Dec 18 2024, 1:47 PM
markj committed rG113875f91607: iflib: Set the NUMA domain in receive packet headers (authored by markj).
iflib: Set the NUMA domain in receive packet headers
Dec 18 2024, 1:47 PM
markj committed rG0c5701ff8fdf: pfkey: Fix some checks in kdebug_sadb() (authored by Tobias Heider <me@tobhe.me>).
pfkey: Fix some checks in kdebug_sadb()
Dec 18 2024, 1:47 PM
markj committed rG60786eb3fe7f: sockstat: Ensure that there is always a space between columns (authored by markj).
sockstat: Ensure that there is always a space between columns
Dec 18 2024, 1:47 PM

Dec 17 2024

markj updated the diff for D47992: jail: Avoid a use-after-free when destroying jails.

Set PR_VNET earlier, so that prison_deref() won't leak the VNET if an
error occurs during jail initialization.

Dec 17 2024, 10:30 PM
markj accepted D48125: namei: add more detail about LOCKSHARED's behavior.

My comments are just suggestions/quibbling.

Dec 17 2024, 8:30 PM
markj planned changes to D47992: jail: Avoid a use-after-free when destroying jails.

The new PR_VNET_ROOT flag is unneeded: it's equivalent to PR_VNET, just check
that instead.

Not quite, I'm afraid. This is true once a prison has been created, but errors during the creation process can break that. pr_vnet is set when a new jail is created, but the flags are not actually set until after some parameter checking and other error opportunities. Chances are, this just requires setting the prison's PR_VNET flag at the same time the vnet is created (still saving other flags for later).

Dec 17 2024, 6:12 PM
markj updated the diff for D47992: jail: Avoid a use-after-free when destroying jails.

Revert unintended style change.

Dec 17 2024, 5:57 PM
markj updated the diff for D47992: jail: Avoid a use-after-free when destroying jails.

The new PR_VNET_ROOT flag is unneeded: it's equivalent to PR_VNET, just check
that instead.

Dec 17 2024, 5:35 PM
markj committed rGfa5f4c10a8ce: atomic: Update interceptor function signatures after commit 5e9a82e898d5 (authored by markj).
atomic: Update interceptor function signatures after commit 5e9a82e898d5
Dec 17 2024, 2:12 PM
markj committed rGda2c88dfcf4f: queue: Fix STAILQ_SWAP (authored by markj).
queue: Fix STAILQ_SWAP
Dec 17 2024, 12:15 AM

Dec 16 2024

markj committed rGcfbbe5d7fa9f: Makefile.inc1: Fix a typo (authored by markj).
Makefile.inc1: Fix a typo
Dec 16 2024, 10:33 PM
markj committed rGb64c5a0ace59: ipfw.d: Add required dependency declarations (authored by markj).
ipfw.d: Add required dependency declarations
Dec 16 2024, 10:16 PM
markj accepted D48058: riscv vmm: add SSTC check.

I have no objection to the current revision, although we can say a few things about how the code may look/change in the future.

Obviously, the feature-to-ISA-string code will continue to expand/balloon, as we will want to advertise the availability of the many unprivileged ISA extensions to the guest as well.

The problem is that we have no mechanism for reporting extension presence from the kernel to userspace, therefore you are using vm_cap_type here. I am working on something "official" for this, most likely it will be a sysarch exporting a bitmap, with bit definitions compatible to what can be found in Linux. Therefore one call can obtain the full set of supported extensions (sanitized), and we will be able to use this in bhyve to construct the ISA string for the guest.

So I don't think we will need to rely on vm_cap_type in the long run. We also don't need to be precious about the ABI, given the experimental state of RISC-V vmm and hypervisor hardware, and since I intend for this extension reporting stuff to be resolved before the release of 15.0. So this VM_CAP_SSTC can easily be removed later.

Dec 16 2024, 6:45 PM