Page MenuHomeFreeBSD

jhb (John Baldwin)
User

Projects (9)

User Details

User Since
Mar 11 2014, 8:46 PM (574 w, 4 d)

Recent Activity

Fri, Mar 14

jhb accepted D49252: acpi_pci: Add quirk for DELAY-after-EJ0.

I assume the parties in question realize that the correct behavior is the bus should be settled with _EJ0 returns, but that since that is on the older systems they don't plan to fix it?

Fri, Mar 14, 5:57 PM
jhb added a comment to D49334: cdev: dev_copyname copies a character device's name to a buffer.
In D49334#1125310, @kib wrote:
In D49334#1125306, @jhb wrote:
In D49334#1125116, @kib wrote:

The reference on cdev still must be held, otherwise dev_refthread() might end up accessing freed memory. For instance, for the csw methods, the safety comes from the fact that devfs VCHR vnodes keep such references on cdev.
Then, cdev->si_name memory is part of the struct cdev, and we do not modify it until free, so dev_copyname() alone is somewhat excessive. Note that vm_object_list_handler() use of dev_refthread() is a) to avoid reporting names for dead VCHR nodes b) to provide some extra safety for obj->cdev memory walk. b) might be too cautious.

Hmmm, I was worried that other device pagers might want to also use this if they store a pointer to their cdev in the handle they use for the pager (like the netmap case) vs just inlining the logic into old_cdev_pager_path. Do you think the dead VCHR case is just as relevant for other device pager objects?

It could be, it really depends on what d_close() does.

Fri, Mar 14, 5:44 PM
jhb accepted D49351: sysctl: Panic on OID reuse.
Fri, Mar 14, 1:20 PM

Thu, Mar 13

jhb committed rGf402078d0956: device_pager: Assert that the handle is not NULL (authored by jhb).
device_pager: Assert that the handle is not NULL
Thu, Mar 13, 5:04 PM
jhb closed D49333: device_pager: Assert that the handle is not NULL.
Thu, Mar 13, 5:03 PM
jhb added a comment to D49334: cdev: dev_copyname copies a character device's name to a buffer.
In D49334#1125116, @kib wrote:

The reference on cdev still must be held, otherwise dev_refthread() might end up accessing freed memory. For instance, for the csw methods, the safety comes from the fact that devfs VCHR vnodes keep such references on cdev.
Then, cdev->si_name memory is part of the struct cdev, and we do not modify it until free, so dev_copyname() alone is somewhat excessive. Note that vm_object_list_handler() use of dev_refthread() is a) to avoid reporting names for dead VCHR nodes b) to provide some extra safety for obj->cdev memory walk. b) might be too cautious.

Thu, Mar 13, 5:01 PM
jhb committed rG00d78c500783: rwmlock/rwlock/sx: Print the pointer of destroyed locks in panic messages (authored by jhb).
rwmlock/rwlock/sx: Print the pointer of destroyed locks in panic messages
Thu, Mar 13, 4:57 PM
jhb closed D49332: rwmlock/rwlock/sx: Print the pointer of destroyed locks in panic messages.
Thu, Mar 13, 4:57 PM
jhb committed rGa52a51a2d590: lockmgr/rmlock/rwlock/sx: Make various assertions more robust (authored by jhb).
lockmgr/rmlock/rwlock/sx: Make various assertions more robust
Thu, Mar 13, 4:57 PM
jhb closed D49331: lockmgr/rmlock/rwlock/sx: Make various assertions more robust.
Thu, Mar 13, 4:57 PM
jhb added a comment to D49163: procstat kqueues: query and display events registered in the process kqueues.

Thanks a bunch of for doing this. This is one of the features I've wanted for a long time as a useful tool to understand what a process might be waiting on. The other thing I would love to have in this vein are a way to see the file descriptors that a thread blocked in select/poll is waiting on (and the specific poll flags for each fd). For that case you could use the existing open file descriptor sysctl/core dump note to get details about each fd, you would just need the list of <fd, poll flags> tuples.

Thu, Mar 13, 4:16 PM
jhb added inline comments to D49183: watchdog: Convert to using sbintime_t format.
Thu, Mar 13, 4:07 PM
jhb added inline comments to D49182: watchdog: Add a new "Control" ioctl.
Thu, Mar 13, 4:02 PM
jhb added a comment to D27113: Only try to retrieve UUID from SMBIOS on x86 machines.

I would maybe structure this so that both hostid_set and uuidgen are only called in one place by first focusing on obtaining or generating the UUID and then setting it, so something like:

Thu, Mar 13, 3:59 PM
jhb accepted D49318: libsa: smbios: Detect less-than-64-bit platforms via __SIZEOF_SIZE_T__.
Thu, Mar 13, 2:31 PM
jhb added a comment to D49318: libsa: smbios: Detect less-than-64-bit platforms via __SIZEOF_SIZE_T__.

PTRDIFF_T isn't quite the same thing. Also, 32-bit CHERI hardware does exist (CHERI-RISC-V such as CHERIoT), it's just that FreeBSD won't be ported to them.

Thu, Mar 13, 2:31 PM
jhb added inline comments to D49309: Add /etc/rc.d/newaliases.
Thu, Mar 13, 2:29 PM
jhb accepted D49308: rc.d/sendmail: remove a obsolete upgrade seatbelt.

Yeah, the check was just copied over from NetBSD when rc.d was imported back in 2001. You'd have to take a system older than that, do source upgrades up to 15 without ever having started sendmail and then try to start it again to be negatively effected. Can't imagine that being an actual use case.

Thu, Mar 13, 2:27 PM

Wed, Mar 12

jhb added a comment to D49337: netmap: Add a cdev_pg_path hook that returns the name of the cdev.

I couldn't find an easy way to test this. The netmap API tests in base don't call nmport_mmap which seems to be the only thing that mmaps this device.

Wed, Mar 12, 8:01 PM
jhb added a comment to D49336: sgx: Add a simple cdev_pg_path method.

I don't have any hardware with SGX so can't test this.

Wed, Mar 12, 8:01 PM
jhb added a comment to D49335: device_pager: Add cdev_pager_get_path to retrieve the "path" for an object.

More interesting would be for someone to fix some of the other drivers in the tree using cdev_pager_allocate() to add methods. I've added two simple examples in this series, but drm-kmod would probably be a more useful one to fix, perhaps by fixing the linuxkpi wrappers?

Wed, Mar 12, 8:00 PM
jhb added a comment to D49335: device_pager: Add cdev_pager_get_path to retrieve the "path" for an object.

I was able to verify that a character device using the default device pager still shows up with a device name in vmstat -o and procstat -v output.

Wed, Mar 12, 7:59 PM
jhb requested review of D49337: netmap: Add a cdev_pg_path hook that returns the name of the cdev.
Wed, Mar 12, 7:59 PM
jhb requested review of D49336: sgx: Add a simple cdev_pg_path method.
Wed, Mar 12, 7:59 PM
jhb requested review of D49335: device_pager: Add cdev_pager_get_path to retrieve the "path" for an object.
Wed, Mar 12, 7:59 PM
jhb requested review of D49334: cdev: dev_copyname copies a character device's name to a buffer.
Wed, Mar 12, 7:58 PM
jhb requested review of D49333: device_pager: Assert that the handle is not NULL.
Wed, Mar 12, 7:58 PM
jhb requested review of D49332: rwmlock/rwlock/sx: Print the pointer of destroyed locks in panic messages.
Wed, Mar 12, 7:19 PM
jhb requested review of D49331: lockmgr/rmlock/rwlock/sx: Make various assertions more robust.
Wed, Mar 12, 7:19 PM
jhb committed rGba6c35f0cadb: usb: Use bus_detach_children instead of bus_generic_detach (authored by jhb).
usb: Use bus_detach_children instead of bus_generic_detach
Wed, Mar 12, 2:55 PM
jhb committed rG43a15a22c623: mtx: Include the mutex pointer in the panic message for destroyed locks (authored by jhb).
mtx: Include the mutex pointer in the panic message for destroyed locks
Wed, Mar 12, 2:48 PM
jhb committed rG0ed104978ce5: mtx: Make idle thread assertions more robust (authored by jhb).
mtx: Make idle thread assertions more robust
Wed, Mar 12, 2:48 PM
jhb committed rGdba45599c498: mtx: Avoid nested panics on lock class mismatch assertions (authored by jhb).
mtx: Avoid nested panics on lock class mismatch assertions
Wed, Mar 12, 2:48 PM
jhb closed D49315: mtx: Include the mutex pointer in the panic message for destroyed locks.
Wed, Mar 12, 2:48 PM
jhb closed D49314: mtx: Make idle thread assertions more robust.
Wed, Mar 12, 2:48 PM
jhb closed D49313: mtx: Avoid nested panics on lock class mismatch assertions.
Wed, Mar 12, 2:48 PM
jhb added a comment to D49314: mtx: Make idle thread assertions more robust.
In D49314#1124614, @kib wrote:

In principle, it might be not a sleep mutex.

Wed, Mar 12, 3:20 AM

Tue, Mar 11

jhb added a comment to D49313: mtx: Avoid nested panics on lock class mismatch assertions.

I ran into this in CheriBSD where a lock was filled with 0xdeadc0de due to a type confusion bug and the value of the lo_name pointer was filled with 0xdeadc0de. Possibly we could keep the assertion as-is but avoiding printing the lock name at all, just print the pointer? OTOH, we don't require matching classes for other locks. I also think the main point of these assertions is to catch cross-threading in the API, so having them narrower but give a meaningful panic string is probably useful (and why I've chosen to fix it this way). (I've long wanted to make a separate struct spinlock or some such and have mtx only be MTX_DEF and then all these assertions would go away as they would become compile errors.)

Tue, Mar 11, 1:45 AM
jhb requested review of D49315: mtx: Include the mutex pointer in the panic message for destroyed locks.
Tue, Mar 11, 1:38 AM
jhb requested review of D49314: mtx: Make idle thread assertions more robust.
Tue, Mar 11, 1:38 AM
jhb requested review of D49313: mtx: Avoid nested panics on lock class mismatch assertions.
Tue, Mar 11, 1:38 AM

Mon, Mar 10

jhb added a comment to D49266: acpi_pci: Use pci_has_pm and pci_clear_pme.

Looks reasonable to me. Should I test in EC2? (If yes, which other patches do I need?)

Mon, Mar 10, 5:39 PM
jhb added a reverting change for rG234683726708: devclass: make devclass_alloc_unit use M_NOWAIT: rG78cd83e4017b: devclass_alloc_unit: Go back to using M_WAITOK.
Mon, Mar 10, 5:36 PM
jhb committed rGb8b5cc330490: new-bus: Use M_WAITOK in more places (authored by jhb).
new-bus: Use M_WAITOK in more places
Mon, Mar 10, 5:36 PM
jhb committed rG78cd83e4017b: devclass_alloc_unit: Go back to using M_WAITOK (authored by jhb).
devclass_alloc_unit: Go back to using M_WAITOK
Mon, Mar 10, 5:36 PM
jhb committed rG02d61f27585f: hdaa: Don't hold a mutex while creating child devices (authored by jhb).
hdaa: Don't hold a mutex while creating child devices
Mon, Mar 10, 5:36 PM
jhb committed rGaaf0a7302d10: sdhci: Use bus_topo_lock and taskqueue_bus for hotplug events (authored by jhb).
sdhci: Use bus_topo_lock and taskqueue_bus for hotplug events
Mon, Mar 10, 5:36 PM
jhb committed rGc0bed9bd0bda: mmc: Use bus_topo_lock and taskqueue_bus while adding/removing child devices (authored by jhb).
mmc: Use bus_topo_lock and taskqueue_bus while adding/removing child devices
Mon, Mar 10, 5:36 PM
jhb closed D49273: devclass_alloc_unit: Go back to using M_WAITOK.
Mon, Mar 10, 5:36 PM
jhb closed D49274: new-bus: Use M_WAITOK in more places.
Mon, Mar 10, 5:36 PM
jhb committed rGb23314ecb99c: pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue (authored by jhb).
pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue
Mon, Mar 10, 5:36 PM
jhb committed rG44d5f5ed1e95: new-bus: Add taskqueue_bus to process hot-plug device events (authored by jhb).
new-bus: Add taskqueue_bus to process hot-plug device events
Mon, Mar 10, 5:36 PM
jhb closed D49272: hdaa: Don't hold a mutex while creating child devices.
Mon, Mar 10, 5:36 PM
jhb closed D49271: sdhci: Use bus_topo_lock and taskqueue_bus for hotplug events.
Mon, Mar 10, 5:36 PM
jhb closed D49270: mmc: Use bus_topo_lock and taskqueue_bus while adding/removing child devices.
Mon, Mar 10, 5:36 PM
jhb closed D49269: pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue.
Mon, Mar 10, 5:36 PM
jhb closed D49268: new-bus: Add taskqueue_bus to process hot-plug device events.
Mon, Mar 10, 5:36 PM
jhb committed rGdb6f2bb93a97: Makefile.inc1: Conditionalize some package related variables (authored by jhb).
Makefile.inc1: Conditionalize some package related variables
Mon, Mar 10, 5:31 PM
jhb closed D49278: Makefile.inc1: Conditionalize some package related variables.
Mon, Mar 10, 5:31 PM
jhb added inline comments to D49288: libsa: smbios: Use 64-bit entry point if table below 4GB on non-EFI boot.
Mon, Mar 10, 2:06 PM

Fri, Mar 7

jhb added a comment to D49278: Makefile.inc1: Conditionalize some package related variables.

@emaste would you be able to test that this works correctly for building base packages?

Fri, Mar 7, 6:22 PM
jhb updated subscribers of D49278: Makefile.inc1: Conditionalize some package related variables.

On a NFS-mounted git worktree without this change:

Fri, Mar 7, 5:06 PM
jhb committed rG7d529b1c8fb5: Makefile.inc1: Correct comment for an .endif (authored by jhb).
Makefile.inc1: Correct comment for an .endif
Fri, Mar 7, 4:58 PM
jhb requested review of D49278: Makefile.inc1: Conditionalize some package related variables.
Fri, Mar 7, 4:55 PM
jhb added a comment to D49272: hdaa: Don't hold a mutex while creating child devices.

Hmm, did you mean to approve this or request changes?

Fri, Mar 7, 12:48 PM
jhb added a comment to D49222: pci: Clear active PME# and disable PME# generation.

The updated series survived multiple sleep/resume cycles on my X1 Carbon including waking due to key press and waking due to opening the lid. I don't have a way to test any of the WOL driver changes however.

Fri, Mar 7, 12:47 PM

Thu, Mar 6

jhb added a comment to D49274: new-bus: Use M_WAITOK in more places.

This booted fine for me (no WITNESS warnings) in both a bhyve VM and my X1 Carbon.

Thu, Mar 6, 10:10 PM
jhb added a comment to D49272: hdaa: Don't hold a mutex while creating child devices.

I can't see a reason to hold the lock in the function, it just calls device_add_child in a loop and is already under the bus_topo_lock. This also does clear up the witness warning I was getting on boot on my X1 Carbon after Warner's original change to use M_WAITOK.

Thu, Mar 6, 10:08 PM
jhb added a reverting change for rG234683726708: devclass: make devclass_alloc_unit use M_NOWAIT: D49273: devclass_alloc_unit: Go back to using M_WAITOK.
Thu, Mar 6, 10:08 PM
jhb requested review of D49273: devclass_alloc_unit: Go back to using M_WAITOK.
Thu, Mar 6, 10:07 PM
jhb requested review of D49274: new-bus: Use M_WAITOK in more places.
Thu, Mar 6, 10:07 PM
jhb requested review of D49272: hdaa: Don't hold a mutex while creating child devices.
Thu, Mar 6, 10:07 PM
jhb requested review of D49271: sdhci: Use bus_topo_lock and taskqueue_bus for hotplug events.
Thu, Mar 6, 10:07 PM
jhb requested review of D49270: mmc: Use bus_topo_lock and taskqueue_bus while adding/removing child devices.
Thu, Mar 6, 10:07 PM
jhb requested review of D49269: pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue.
Thu, Mar 6, 10:07 PM
jhb requested review of D49268: new-bus: Add taskqueue_bus to process hot-plug device events.
Thu, Mar 6, 10:07 PM
jhb closed D49220: netmap: Disable a buggy and unsafe test (sync_kloop_conflict).
Thu, Mar 6, 6:24 PM
jhb committed rGecb3a7d43dd6: netmap: Disable a buggy and unsafe test (sync_kloop_conflict) (authored by jhb).
netmap: Disable a buggy and unsafe test (sync_kloop_conflict)
Thu, Mar 6, 6:24 PM
jhb requested review of D49267: pci: Use a single variable for the offset of the power management registers.
Thu, Mar 6, 6:20 PM
jhb requested review of D49266: acpi_pci: Use pci_has_pm and pci_clear_pme.
Thu, Mar 6, 6:20 PM
jhb updated the diff for D49250: pci: Add helper routines to manage PME in device drivers.

Rebase

Thu, Mar 6, 6:20 PM
jhb updated the diff for D49222: pci: Clear active PME# and disable PME# generation.

Rebase

Thu, Mar 6, 6:19 PM

Wed, Mar 5

jhb updated the diff for D49250: pci: Add helper routines to manage PME in device drivers.

Add manpage changes

Wed, Mar 5, 10:06 PM
jhb updated the diff for D49222: pci: Clear active PME# and disable PME# generation.

Add manpage changes

Wed, Mar 5, 10:06 PM
jhb retitled D49250: pci: Add helper routines to manage PME in device drivers from pci: Add a helper routines to manage PME in device drivers to pci: Add helper routines to manage PME in device drivers.
Wed, Mar 5, 9:56 PM
jhb requested review of D49251: dev: Use recently added improvements to PME# support to simplify drivers.
Wed, Mar 5, 9:55 PM
jhb requested review of D49250: pci: Add helper routines to manage PME in device drivers.
Wed, Mar 5, 9:55 PM
jhb added a comment to D49222: pci: Clear active PME# and disable PME# generation.

Existing device drivers cleared PME# first in their resume methods before messing with device registers, so do the same in pci_resume_child.

Wed, Mar 5, 9:55 PM
jhb updated the summary of D49222: pci: Clear active PME# and disable PME# generation.
Wed, Mar 5, 9:54 PM
jhb updated the diff for D49222: pci: Clear active PME# and disable PME# generation.

Clear PME earlier in resume

Wed, Mar 5, 9:53 PM
jhb accepted D49146: acpi_pci: Add quirk for PSTAT_PME-before-detach.

This generally looks good to me. I have a suggestion, but it is approved regardless.

Wed, Mar 5, 5:32 PM
jhb committed rG8ee127efb045: vm_lowmem: Fix signature mismatches in vm_lowmem callbacks (authored by aokblast).
vm_lowmem: Fix signature mismatches in vm_lowmem callbacks
Wed, Mar 5, 1:20 AM
jhb committed rG22b0052fdd95: geli: Fix signature mismatch in mountroot callback (authored by aokblast).
geli: Fix signature mismatch in mountroot callback
Wed, Mar 5, 1:20 AM
jhb closed D49111: vm_lowmem: fix signature mismatch for lowmem event dispatcher.
Wed, Mar 5, 1:20 AM
jhb added a comment to D49111: vm_lowmem: fix signature mismatch for lowmem event dispatcher.

FYI, I split out the geli fix into a separate commit from the vm_lowmem fixes and tweaked the commit message slightly.

Wed, Mar 5, 1:20 AM

Tue, Mar 4

jhb added a comment to D49223: src: Use c++17 as the default C++ standard.

My gut feeling is that C++ 20 is too new still, but we may want to more clearly define what "too new" means. GDB's standard is something like "what is the max C++ version supported by the newest compiler that can be installed on the oldest supported Linux LTS" or some such, and GDB is currently at C++17.

Tue, Mar 4, 12:56 AM
jhb added a comment to D49222: pci: Clear active PME# and disable PME# generation.

This doesn't cause any problems in EC2, but it doesn't solve the "recognizing that we're ready for an nvme disk to go away" problem either. They're definitely using a write to the power status register as a cue to remove the device (per https://reviews.freebsd.org/D49146 ).

Tue, Mar 4, 12:41 AM
jhb added inline comments to D49222: pci: Clear active PME# and disable PME# generation.
Tue, Mar 4, 12:36 AM

Mon, Mar 3

jhb added a comment to D49223: src: Use c++17 as the default C++ standard.

This passes most of make tinderbox (it is finishing the last few arches for me still). It will need an exp-run as well.

Mon, Mar 3, 9:51 PM
jhb requested review of D49223: src: Use c++17 as the default C++ standard.
Mon, Mar 3, 9:50 PM