Page MenuHomeFreeBSD

Keep per-timer interrupt data together
ClosedPublic

Authored by andrew on Nov 17 2022, 6:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 16 2024, 6:06 AM
Unknown Object (File)
Oct 16 2024, 6:06 AM
Unknown Object (File)
Oct 9 2024, 12:32 AM
Unknown Object (File)
Oct 2 2024, 8:27 AM
Unknown Object (File)
Oct 2 2024, 8:15 AM
Unknown Object (File)
Oct 2 2024, 6:28 AM
Unknown Object (File)
Oct 2 2024, 1:56 AM
Unknown Object (File)
Sep 30 2024, 1:14 PM
Subscribers

Details

Summary

Eliminate a redundant resource array allow possible use by bhyve later.

Sponsored by: Arm Ltd
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Rebase and rework as a possible alternative to D39074 to remove redundant information

andrew added a reviewer: kevans.

IMO let's go one step further and remove the significance of the index into sc->irqs

sys/arm/arm/generic_timer.c
659

This is guaranteed by virtue of the fact that GT_VIRT is not RF_OPTIONAL, we can do this unconditionally for arm64 (and the other block unconditionally for arm)

675

Iterate over all nitems(sc->irqs), filter on actual rid

683

0 to i

691

Ditto above; we can do this unconditionally, we know it's present.

694–695

These could be reduced to just sc->physical && HAS_PHYS or even just HAS_PHYS; we're guaranteed at least the phys timer (if not the sec-phys timer)

I'm actually happy with this as-is whether we go the extra step right now or not, forgot to click the button.

This revision is now accepted and ready to land.Mar 14 2023, 3:14 PM

I'll go with this for now to be a mechanical change, then plan to clean up in a future change.

There are some complications with virtual timer interrupts and bhyve. The easiest way to handle it is to not enable them when the hypervisor is enabled & use the physical timer in the kernel.

sys/arm/arm/generic_timer.c
659

I'll replace with HAS_HYP as we need to use the physical timer in the kernel with bhyve.

694–695

I'll replace the resource checks with a KASSERT. sc->physical is incorrect here because firmware may leave the physical timer enabled so this is careful to disable the physical timer if present.

This revision was automatically updated to reflect the committed changes.