x86: Refactor Intel `init_cpu_features`
authorNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 7 Jun 2023 18:18:02 +0000 (13:18 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Mon, 12 Jun 2023 16:33:39 +0000 (11:33 -0500)
commitf193ea20eddc6cef84cba54cf1a647204ee6a86b
treef0b8c5f9638e612ec9d59cb3d1a87dfd2570f531
parentaf992e7abdc9049714da76cae1e5e18bc4838fb8
x86: Refactor Intel `init_cpu_features`

This patch should have no affect on existing functionality.

The current code, which has a single switch for model detection and
setting prefered features, is difficult to follow/extend. The cases
use magic numbers and many microarchitectures are missing. This makes
it difficult to reason about what is implemented so far and/or
how/where to add support for new features.

This patch splits the model detection and preference setting stages so
that CPU preferences can be set based on a complete list of available
microarchitectures, rather than based on model magic numbers.
Reviewed-by: DJ Delorie <dj@redhat.com>
sysdeps/x86/cpu-features.c