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)
Wed, Jul 10, 2:44 AM
Unknown Object (File)
Thu, Jun 20, 1:33 PM
Unknown Object (File)
Jun 3 2024, 12:50 PM
Unknown Object (File)
May 23 2024, 1:53 PM
Unknown Object (File)
May 22 2024, 2:38 AM
Unknown Object (File)
May 21 2024, 12:44 PM
Unknown Object (File)
Apr 30 2024, 9:19 PM
Unknown Object (File)
Apr 29 2024, 6:16 AM
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.