On Tue, Jan 20 2026, Peter Maydell <[email protected]> wrote: > On Tue, 20 Jan 2026 at 14:15, Thomas Huth <[email protected]> wrote: >> >> On 20/01/2026 13.55, Peter Maydell wrote: >> > On Tue, 20 Jan 2026 at 12:21, Thomas Huth <[email protected]> wrote: >> >> >> >> From: Thomas Huth <[email protected]> >> >> >> >> The hw_compat_* arrays in hw/core/machine.c should be used for generic >> >> compat settings that might affect all (or at least multiple) machines. >> >> Target specific settings should rather go into the target specific >> >> source files instead. For arm/aarch64, the virt machine is the only >> >> one that cares about compat settings, so move the "arm-cpu" related >> >> switches to hw/arm/virt.c now.
FWIW, this is not the only arch-specific setting in there, and I don't think it's really bothersome. There are many compat settings that might not be applicable when you spin up a machine, and that's fine. >> > >> > I think it makes more sense for all the compat stuff to >> > live in one place, rather than being scattered around, >> > unless it is truly machine-specific (which this isn't). >> >> It's only used by the arm virt machine, so it's IMHO machine specific. >> If we will ever get other versionized arm machines, they won't use these >> config knobs, so this never will be shared with another machine. > > It happens to be only used by the virt board, but that's just > a coincidence that we only have one versioned arm board right > now. The config knob itself is not at all board specific: > it applies to a device object that is used by many boards and > sets a behaviour that would usefully apply to all of them. > If we ever did have more arm versioned machines in the future > we'd end up with a weird split where compat properties of the CPU > object that happened to pre-date the addition of that second > machine type would be in one place in the source code, and > properties that happened to post-date the second machine > type would be somewhere else. I think there are only two options that really make sense: - keep the compat setting where it is - introduce an arm specific compat array that can be included by the virt machine and any future versioned arm machine Not sure if the latter is actually worth the hassle.
