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)
Mar 4 2024, 8:13 PM
Unknown Object (File)
Jan 13 2024, 10:29 PM
Unknown Object (File)
Jan 12 2024, 8:21 AM
Unknown Object (File)
Dec 23 2023, 1:47 AM
Unknown Object (File)
Nov 10 2023, 11:43 AM
Unknown Object (File)
Nov 7 2023, 7:02 AM
Unknown Object (File)
Sep 29 2023, 7:38 PM
Unknown Object (File)
Sep 23 2023, 3:05 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.