Page MenuHomeFreeBSD

arm64: Add a new CPU feature framework
ClosedPublic

Authored by andrew on Nov 27 2024, 6:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 9, 11:01 PM
Unknown Object (File)
Tue, Feb 4, 5:00 PM
Unknown Object (File)
Sun, Feb 2, 9:17 PM
Unknown Object (File)
Fri, Jan 31, 4:59 AM
Unknown Object (File)
Fri, Jan 31, 12:31 AM
Unknown Object (File)
Thu, Jan 30, 2:19 PM
Unknown Object (File)
Mon, Jan 27, 3:53 PM
Unknown Object (File)
Fri, Jan 24, 1:14 PM
Subscribers

Details

Summary

This will be used to enable features that are discoverable on boot. It
has support to check if a feature needs to be enabled, and if there is
any errata associated with the feature that mean it shouldn't be
enabled. It can also be used to enable errata workarounds that aren't
associated with a specific feature, e.g. where we need to trap access
to a register in userspace to emulate it.

As some features need to be enabled early, while others can wait there
are two options for when to enable a feature:

  • CPU_FEAT_EARLY_BOOT: The feature will be enabled early in the boot. On the boot CPU this is in initarm, while on secondary CPUs this is before signalling the CPU has started.
  • CPU_FEAT_AFTER_DEV: The feature will be enabled after devices have attached but before interrupts are enabled.

There are also two scopes for where to enable the feature:

  • CPU_FEAT_PER_CPU: The feature will be checked and enabled on all CPU cores.
  • CPU_FEAT_SYSTEM: The feature will only be checked and enabled on a single core.

It is expected the former will be used for most features, while the
latter is for features that set a global variable to be checked.

Sponsored by: Arm Ltd

Diff Detail

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

Event Timeline

Create an enum to describe the status of a workaround

Allow multiple errata to be returned from feat_has_errata.

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Jan 24, 12:12 PM
This revision was automatically updated to reflect the committed changes.