Page MenuHomeFreeBSD

jhb (John Baldwin)
User

Projects (9)

User Details

User Since
Mar 11 2014, 8:46 PM (554 w, 2 d)

Recent Activity

Yesterday

jhb committed rGf0bc751d6fb4: csa: Use pci_find_device to simplify clkrun_hack (authored by jhb).
csa: Use pci_find_device to simplify clkrun_hack
Thu, Oct 24, 2:24 PM
jhb closed D47222: csa: Use pci_find_device to simplify clkrun_hack.
Thu, Oct 24, 2:24 PM
jhb added a comment to D46788: Reapply "Assert that mbufs are writable if we write to them".

@kp are you ok with this change? I think m_unshare can still be resolved orthogonally from the rest of this series.

Thu, Oct 24, 2:20 PM
jhb committed rG8c8ebbb04518: bhyve ahci: Improve robustness of TRIM handling (authored by jhb).
bhyve ahci: Improve robustness of TRIM handling
Thu, Oct 24, 2:19 PM
jhb closed D47224: bhyve ahci: Improve robustness of TRIM handling.
Thu, Oct 24, 2:19 PM
jhb added inline comments to D47224: bhyve ahci: Improve robustness of TRIM handling.
Thu, Oct 24, 2:00 PM
jhb added a comment to D47254: DMAR: handle affinity for in-memory data structures.
In D47254#1077677, @kib wrote:
In D47254#1077565, @jhb wrote:

So the acpi bus will need some way to recognize special DMAR devices (e.g. a custom ivar) in acpi_get_domain(), and then for DMAR devices it needs to call some other helper routine instead of acpi_parse_pxm() that looks up the domain.

I do not want to push a knowledge about DMAR into acpi. Would something like this work: add a 'fake' bus dmarbus0 below acpi0, with the only non-default method BUS_GET_DOMAIN(), and make all dmarX children of dmarbus0, so the hierarchy would be

dmarX dmarbus0 acpi0 nexus0

Then dmarbus0 method is called and knows how to calculate the domain?

Thu, Oct 24, 1:43 PM

Wed, Oct 23

jhb added a comment to D47252: acpi_gpiobus: Use non-rman resource activation.

Hmmm, if the logic is the same for all IRQ resources ever allocated on intrng architectures, then doing it in the wrapper might indeed be simplest.

Wed, Oct 23, 3:40 PM
jhb added a comment to D46786: m_unshare: Fail with a NULL return if the chain contains unmapped mbufs.
In D46786#1077536, @kp wrote:
In D46786#1077456, @jhb wrote:
In D46786#1074982, @kp wrote:

That seems reasonable, yes. Ideally I'd like to be able to assert that assumption (probably in pf_pull_hdr()) though.

It's also not the only case where we currently call m_unshare() to make sure we can access all the relevant data. I wound up adding one to if_ovpn here: https://cgit.freebsd.org/src/commit/sys/net/if_ovpn.c?id=5644e2c6d47c6113a61ab7fc0776b7227677656a
Short version, in kib's words: "ftpd uses sendfile(2) AFAIR, and the symptoms of the file corruption mean that M_RDONLY mbuf, of type M_EXTPG, modified by the network stack"

Hmmm, so for KTLS, we are careful to recognize when the pages of an unmapped mbuf are "borrowed" and allocate anonymous pages for encrypting them explicitly. I wonder if for DCO you want/need to be doing something similar to protect against what kib@ describes? In particular, check ktls_encrypt_record() in sys/kern/uipc_ktls.c and how it uses EPG_FLAG_ANON to detect "anonymous" writable pages vs borrowed pages. (Potentially once this series lands that makes M_RDONLY correct for unmapped mbufs we could retire EPG_FLAG_ANON and depend on M_RDONLY for that instead.)

Right, we'll have to detect M_RDONLY (and potentially EPG_FLAG_ANON too, unless it's retired first) and then convince opencrypto to write the output somewhere else.
Presumably we can 'just' allocate a new mbuf for the result and then call crypto_use_output_mbuf()?

I'm slightly reluctant to mess with what we have now, and not (just) because of laziness. I never actually managed to reproduce https://bugs.freebsd.org/280036 myself, so I don't have a setup to test that. Still, it looks like that's the direction we ought to go with this.

Wed, Oct 23, 1:57 PM
jhb added a comment to D47224: bhyve ahci: Improve robustness of TRIM handling.

@mav does this version look ok? It still works for me with the basic 'newfs -E' test in a VM.

Wed, Oct 23, 1:44 PM
jhb added a comment to D47252: acpi_gpiobus: Use non-rman resource activation.

Presumably the gpiobus driver needs to call into subr_intr.c for those platforms then? (And that needs to happen in gpiobus.c, this is not ACPI specific)

Wed, Oct 23, 1:43 PM
jhb added a comment to D47254: DMAR: handle affinity for in-memory data structures.

So the acpi bus will need some way to recognize special DMAR devices (e.g. a custom ivar) in acpi_get_domain(), and then for DMAR devices it needs to call some other helper routine instead of acpi_parse_pxm() that looks up the domain.

Wed, Oct 23, 1:42 PM

Tue, Oct 22

jhb added a comment to D47254: DMAR: handle affinity for in-memory data structures.

Yes, the acpi_get_domain() would have to recognize dmar devices and do special handling. Today it just handles _PXM methods on Device objects, and if a device doesn't have a _PXM method it just punts. Presumably the DMAR devices are not Device nodes in the ACPI namespace and thus don't have a _PXM method?

Tue, Oct 22, 9:05 PM
jhb added a comment to D47252: acpi_gpiobus: Use non-rman resource activation.

Eh, this doesn't seem correct on the surface. How are the resources being allocated? If they are being allocated via gpiobus_alloc_resource(), then it is wrong to pass those resources up to some random other device driver in the tree and ask it to activate a resource it didn't create and doesn't know how to manage. Do you have more details on "that wasn't working"? Do you get a panic?

Tue, Oct 22, 9:01 PM
jhb accepted D47242: style.9: clarify FALLTHROUGH.
Tue, Oct 22, 8:58 PM
jhb added a comment to D46786: m_unshare: Fail with a NULL return if the chain contains unmapped mbufs.
In D46786#1074982, @kp wrote:

That seems reasonable, yes. Ideally I'd like to be able to assert that assumption (probably in pf_pull_hdr()) though.

It's also not the only case where we currently call m_unshare() to make sure we can access all the relevant data. I wound up adding one to if_ovpn here: https://cgit.freebsd.org/src/commit/sys/net/if_ovpn.c?id=5644e2c6d47c6113a61ab7fc0776b7227677656a
Short version, in kib's words: "ftpd uses sendfile(2) AFAIR, and the symptoms of the file corruption mean that M_RDONLY mbuf, of type M_EXTPG, modified by the network stack"

Tue, Oct 22, 8:54 PM
jhb added a reviewer for D47222: csa: Use pci_find_device to simplify clkrun_hack: christos.
Tue, Oct 22, 1:53 PM

Mon, Oct 21

jhb updated the diff for D47224: bhyve ahci: Improve robustness of TRIM handling.

Correct synchronous command completion handling

Mon, Oct 21, 7:00 PM
jhb added inline comments to D47224: bhyve ahci: Improve robustness of TRIM handling.
Mon, Oct 21, 5:25 PM
jhb added a comment to D47224: bhyve ahci: Improve robustness of TRIM handling.

There are also various races (I think) with the CIFS being changed by the guest while a request is in flight. We really should be caching the CIFS for the duration of a command. The issue there though is that CIFS is variable-sized. :( We could at least cache the common header though I think which would probably handle all of the races I can see.

Mon, Oct 21, 4:21 PM
jhb added a comment to D47224: bhyve ahci: Improve robustness of TRIM handling.

This fixes a regression from the previous fix. With current main if you just boot a VM with an AHCI attached disk backed by a zvol (so supports TRIM) and do newfs -E /dev/ada0 the guest FreeBSD kernel hangs in a loop of AHCI timeouts as mav@ worried in the previous review. I hadn't expected that the previous review was actually broken, but my guess is the added done >= sizeof(buf) - 8 check was wrong. It probably should have been '>' instead as if you get a full 512 byte block, it will break from the loop before the last valid entry and never send a reply leading to the hang.

Mon, Oct 21, 4:16 PM
jhb requested review of D47224: bhyve ahci: Improve robustness of TRIM handling.
Mon, Oct 21, 4:09 PM
jhb added a comment to D47028: vmm: Add a device file interface for creating and destroying VMs.

Historically I had wanted the 'maxcpus' tunable to be one of the possible settings at creation time (and an nvlist is how I would have passed in such settings). However, I think I've mostly made that requirement OBE in practice.

Mon, Oct 21, 3:54 PM
jhb accepted D46062: iflib(4): Replace admin taskqueue group with per-interface taskqueues.

This looks ok to me, though I'm not intimately familiar with all of iflib.

Mon, Oct 21, 3:53 PM
jhb accepted D47030: libvmmapi: Use the vmmctl device file to create and destroy VMs.
Mon, Oct 21, 3:34 PM
jhb accepted D47032: bhyve: Convert to using vm_openf().
Mon, Oct 21, 3:33 PM
jhb accepted D47031: bhyvectl: Convert to use vm_openf().
Mon, Oct 21, 3:32 PM
jhb added inline comments to D47030: libvmmapi: Use the vmmctl device file to create and destroy VMs.
Mon, Oct 21, 3:31 PM
jhb accepted D47029: include: Install dev/vmm headers.
Mon, Oct 21, 3:26 PM
jhb accepted D47028: vmm: Add a device file interface for creating and destroying VMs.
Mon, Oct 21, 3:26 PM
jhb added a comment to D46948: cd9660: Preserve non-access permission bits in file modes.
In D46948#1075027, @jhb wrote:

OTOH, if we had any writable filesystems for which the sticky bit was relevant, I do think it would be simpler and more flexible if the masks applied to ALLPERMS instead of just ACCESSPERMS. msdosfs wouldn't change its defacto semantics if we made that change since it doesn't support those bits anyway.

I was also thinking along this line. I agree with both of you that in this case it doesn't seem to matter much, but consistency is also important and accommodating for future R/W filesystems (or the addition of masks to existing ones) tends to push towards just applying the mask to ALLPERMS. For the sticky bit, as you said, but perhaps also to be able to selectively allow only one the setuid and setgid bits (an effect which could be obtained alternatively through new mount options).

If keeping the current behavior, I would recommend ensuring that the mount fails if non-supported bits in the mask are specified. That way, an extension to more bits would still be possible in the future without breaking compatibility.

Mon, Oct 21, 3:09 PM
jhb added a comment to P649 Command-Line Input.

I'm not opposed to that necessarily. We discussed this a bit more in the review at D46948 if you'd like to chime in there.

Mon, Oct 21, 3:08 PM
jhb added inline comments to D46752: [hb]: Update instructions to update from source.
Mon, Oct 21, 3:07 PM
jhb added inline comments to D46889: queue: New debug macros for STAILQ.
Mon, Oct 21, 2:59 PM
jhb committed rG0e3a21196101: ctl_report_supported_opcodes: Handle invalid requested service action (authored by jhb).
ctl_report_supported_opcodes: Handle invalid requested service action
Mon, Oct 21, 2:54 PM
jhb closed D46611: ctl_report_supported_opcodes: Handle invalid requested service action.
Mon, Oct 21, 2:54 PM
jhb requested review of D47222: csa: Use pci_find_device to simplify clkrun_hack.
Mon, Oct 21, 2:35 PM
jhb requested review of D47221: vf_i2c: Don't hold a mutex across bus_generic_detach.
Mon, Oct 21, 2:35 PM
jhb requested review of D47220: ignore_pci: Add a proper stub attach routine.
Mon, Oct 21, 2:35 PM
jhb requested review of D47219: fixup_pci: Remove unused attach DEVMETHOD.
Mon, Oct 21, 2:35 PM
jhb committed rG5201decc8b43: Use bus_delayed_attach_children instead of its inline implementation (authored by jhb).
Use bus_delayed_attach_children instead of its inline implementation
Mon, Oct 21, 2:27 PM
jhb committed rGab4f969f8d30: legacy cpu: Add proper device_probe and device_attach routines (authored by jhb).
legacy cpu: Add proper device_probe and device_attach routines
Mon, Oct 21, 2:27 PM
jhb committed rGce968b095e75: cpufreq: Use a real device_probe routine (authored by jhb).
cpufreq: Use a real device_probe routine
Mon, Oct 21, 2:27 PM
jhb closed D47186: Use bus_delayed_attach_children instead of its inline implementation.
Mon, Oct 21, 2:27 PM
jhb closed D47185: legacy cpu: Add proper device_probe and device_attach routines.
Mon, Oct 21, 2:27 PM
jhb closed D47184: cpufreq: Use a real device_probe routine.
Mon, Oct 21, 2:27 PM

Fri, Oct 18

jhb requested review of D47186: Use bus_delayed_attach_children instead of its inline implementation.
Fri, Oct 18, 7:29 PM
jhb requested review of D47185: legacy cpu: Add proper device_probe and device_attach routines.
Fri, Oct 18, 7:29 PM
jhb requested review of D47184: cpufreq: Use a real device_probe routine.
Fri, Oct 18, 7:29 PM
jhb accepted D47179: ipmi: remove timeout from the ipmi_driver_request method.
Fri, Oct 18, 7:06 PM

Thu, Oct 17

jhb accepted D47042: cxgbe/t4_tom: Change stid allocation strategy to be more IPv6 friendly..
Thu, Oct 17, 4:44 PM
jhb committed rGd1516ec33e66: nvmf: Fail pass through commands while a controller is not associated (authored by jhb).
nvmf: Fail pass through commands while a controller is not associated
Thu, Oct 17, 4:10 PM

Wed, Oct 16

jhb committed rG60516a51abd4: devinfo: Output device description in verbose mode (authored by jhb).
devinfo: Output device description in verbose mode
Wed, Oct 16, 6:11 PM
jhb closed D47157: devinfo: Output device description in verbose mode.
Wed, Oct 16, 6:11 PM
jhb committed rG3342afcbaf42: bus_generic_detach: Remove redundant check (authored by jhb).
bus_generic_detach: Remove redundant check
Wed, Oct 16, 6:11 PM
jhb closed D47156: bus_generic_detach: Remove redundant check.
Wed, Oct 16, 6:11 PM
jhb closed D47155: device_attach: Invoke BUS_CHILD_DETACHED if an attach routine fails.
Wed, Oct 16, 6:11 PM
jhb committed rG42078dfb0f72: device_attach: Invoke BUS_CHILD_DETACHED if an attach routine fails (authored by jhb).
device_attach: Invoke BUS_CHILD_DETACHED if an attach routine fails
Wed, Oct 16, 6:11 PM
jhb closed D47154: device_delete_child: Update comments.
Wed, Oct 16, 6:10 PM
jhb committed rG1ad335196656: device_delete_child: Update comments (authored by jhb).
device_delete_child: Update comments
Wed, Oct 16, 6:10 PM
jhb added a comment to D47157: devinfo: Output device description in verbose mode.

I've found this useful as you can now see which drivers fail to set a description (among other things). :)

Wed, Oct 16, 6:07 PM
jhb added a comment to D47155: device_attach: Invoke BUS_CHILD_DETACHED if an attach routine fails.

I don't think the parent can interfere here as DEVICE_ATTACH calls the child method directly without giving the parent driver a chance to interpose.

Wed, Oct 16, 6:06 PM
jhb added a comment to D46948: cd9660: Preserve non-access permission bits in file modes.
In D46948#1074919, @jhb wrote:

@olce Rock Ridge extensions support extended modes like sticky bits on ISO images.

Ah thanks, missed that.

Shouldn't the masks allow to clear the non-ACCESSPERMS bits? Or are you considering that redundant with, e.g., the nosuid mount option?

Wed, Oct 16, 6:05 PM
jhb committed rG47f49dd4bbb4: sdt: Tear down probes in kernel modules during kldunload (authored by jhb).
sdt: Tear down probes in kernel modules during kldunload
Wed, Oct 16, 5:51 PM
jhb closed D46890: sdt: Tear down probes in kernel modules during kldunload.
Wed, Oct 16, 5:51 PM
jhb requested review of D47157: devinfo: Output device description in verbose mode.
Wed, Oct 16, 3:27 PM
jhb requested review of D47156: bus_generic_detach: Remove redundant check.
Wed, Oct 16, 3:27 PM
jhb requested review of D47155: device_attach: Invoke BUS_CHILD_DETACHED if an attach routine fails.
Wed, Oct 16, 3:27 PM
jhb requested review of D47154: device_delete_child: Update comments.
Wed, Oct 16, 3:27 PM
jhb added a comment to D46786: m_unshare: Fail with a NULL return if the chain contains unmapped mbufs.

Humm, I posit that pf(4) will never need to look into the content of unmapped mbufs. They will always be "plain" packet data (either data from a call to write(2) or sendfile(2)) and never headers inserted by any protocol layer. You can also get them for things like iSCSI and NVMe PDUs, but again only for the data portion, not even for PDU headers (which are in plain mbufs). The reason being that protocol headers have to be constructed, and the code that constructs the headers is going to want a mapped mbuf that it can write into. It could be that what we say here is that m_unshare() does not un-share unmapped mbufs but instead just bumps the refcount on the backing mbuf. We could certainly add a new helper of sorts that is something like m_mapped(m, off, len) that pf(4) could use before calls to m_pullup(). However, it is also true that nothing should be reading the unencrypted data in NIC TLS mbufs (where the NIC does the encryption so the data stays unencrypted all the way down the stack).

Wed, Oct 16, 3:00 PM
jhb added a comment to D46948: cd9660: Preserve non-access permission bits in file modes.

@olce Rock Ridge extensions support extended modes like sticky bits on ISO images. msdosfs has no way to store such bits and the permissions are all synthetic for msdosfs.

Wed, Oct 16, 2:54 PM

Tue, Oct 15

jhb updated the diff for D46948: cd9660: Preserve non-access permission bits in file modes.

Adjust ()s to quiet warnings

Tue, Oct 15, 3:59 PM
jhb added a comment to D46786: m_unshare: Fail with a NULL return if the chain contains unmapped mbufs.

So would ya'll rather me fix m_unshare()? It's clearly not being used today on unmapped mbufs today as it would be panicking when it used the pointers returned from mtod(), so I wouldn't be able to test it.

Tue, Oct 15, 3:56 PM
jhb added a comment to D46785: netinet*: Add assertions for some places that don't support M_EXTPG mbufs.

Ping

Tue, Oct 15, 3:54 PM
jhb added a comment to D45950: vtnet: Fix an LOR in the input path.
In D45950#1073880, @jhb wrote:

I don't think we need the taskqueue. It's probably just a design copied from the Intel drivers, and I don't think it makes much sense for those either. The other thing that can be nice to do though when making this change is to instead build a temporary list of packets linked via m_nextpkt (mbufq works for this) and pass an entire batch to if_input. This lets you avoid dropping the lock as often.

What I dislike about m_nextpkt() is that you trade pointer chasing for lock frobbing. I tend to think an rx ring lock is a kludge that's almost never really needed. But if enough drivers are doing this, we might want to consider an mbuf array method for if_input.

Tue, Oct 15, 3:19 PM

Mon, Oct 14

jhb added a comment to D45950: vtnet: Fix an LOR in the input path.

I don't think we need the taskqueue. It's probably just a design copied from the Intel drivers, and I don't think it makes much sense for those either. The other thing that can be nice to do though when making this change is to instead build a temporary list of packets linked via m_nextpkt (mbufq works for this) and pass an entire batch to if_input. This lets you avoid dropping the lock as often.

Mon, Oct 14, 6:17 PM

Fri, Oct 4

jhb requested review of D46948: cd9660: Preserve non-access permission bits in file modes.
Fri, Oct 4, 9:53 PM
jhb added inline comments to D46890: sdt: Tear down probes in kernel modules during kldunload.
Fri, Oct 4, 9:50 PM
jhb created P649 Command-Line Input.
Fri, Oct 4, 8:57 PM
jhb added inline comments to D46890: sdt: Tear down probes in kernel modules during kldunload.
Fri, Oct 4, 7:04 PM

Thu, Oct 3

jhb requested review of D46890: sdt: Tear down probes in kernel modules during kldunload.
Thu, Oct 3, 6:02 PM
jhb committed rG59f5f100b774: openzfs: Reduce local diffs (authored by jhb).
openzfs: Reduce local diffs
Thu, Oct 3, 4:08 PM
jhb closed D46530: openzfs: Reduce local diffs.
Thu, Oct 3, 4:08 PM
jhb added a comment to D25747: geli: use a single crypto session for each provider.

Is the issue you mentioned previously that you are worried that some drivers might not support concurrent requests on a session? I can't recall if all drivers are ready for this. ccr(4) is at least, though it will perform better if you use separate sessions (Chelsio NICs have multiple crypto engines and each session is tied to a specific engine).

Thu, Oct 3, 2:12 PM

Wed, Oct 2

jhb committed rGad152571b8fd: bhyve uart: Fix errors from GCC (authored by jhb).
bhyve uart: Fix errors from GCC
Wed, Oct 2, 9:41 PM
jhb added a comment to D46611: ctl_report_supported_opcodes: Handle invalid requested service action.

Ping @asomers

Wed, Oct 2, 7:23 PM
jhb added a comment to D46530: openzfs: Reduce local diffs.

Ping

Wed, Oct 2, 7:22 PM
jhb updated subscribers of D46530: openzfs: Reduce local diffs.
Wed, Oct 2, 7:22 PM
jhb committed rG519981e3c09c: tcp_output: Clear FIN if tcp_m_copym truncates output length (authored by jhb).
tcp_output: Clear FIN if tcp_m_copym truncates output length
Wed, Oct 2, 7:14 PM
jhb closed D46824: tcp_output: Clear FIN if tcp_m_copym truncates output length.
Wed, Oct 2, 7:14 PM
jhb committed rGc08e016f000c: unix: Use a dedicated mtx pool for vnode name locks (authored by jhb).
unix: Use a dedicated mtx pool for vnode name locks
Wed, Oct 2, 7:14 PM
jhb closed D46792: unix: Use a dedicated mtx pool for vnode name locks.
Wed, Oct 2, 7:14 PM
jhb added a comment to D46792: unix: Use a dedicated mtx pool for vnode name locks.

Ok, I'll drop it to 32 for commit then.

Wed, Oct 2, 6:59 PM
jhb added a comment to D46824: tcp_output: Clear FIN if tcp_m_copym truncates output length.

I can fix the type mismatch during commit. I have not looked to see if other stacks are affected.

Wed, Oct 2, 6:56 PM

Mon, Sep 30

jhb committed rG4fa4693dcdd8: btx: Align the PXE prompt with other options (authored by Tatsuki Makino <tatsuki_makino@hotmail.com>).
btx: Align the PXE prompt with other options
Mon, Sep 30, 7:45 PM
jhb updated the diff for D46824: tcp_output: Clear FIN if tcp_m_copym truncates output length.

Switch to old_len

Mon, Sep 30, 5:30 PM
jhb added a comment to D46572: opencrypto: assert that mbufs are writable.

You might try doing this again after my other series lands. In this case though I think you'd need M_WRITABLE_EXTPG.

Mon, Sep 30, 4:11 PM
jhb added a comment to D38420: lindebugfs: Update fops_blob_read to operate on a kernel pointer..

Looks kind of similar. I have it as a downstream diff in CheriBSD as otherwise it don't compile at all. (CheriBSD doesn't let you mix and match user vs kernel pointers willy-nilly as they are different types.) I guess I'll have to deal with the merge conflict when merging your other change.

Mon, Sep 30, 4:09 PM
jhb accepted D46400: [RISC-V] Set ra to zero when calling into userspace.

This is fine for now. I do think long term we want to figure out the minimum set of registers to preserve for each arch and zero the rest.

Mon, Sep 30, 2:30 PM

Fri, Sep 27

jhb added inline comments to D46786: m_unshare: Fail with a NULL return if the chain contains unmapped mbufs.
Fri, Sep 27, 9:53 PM