On Tue, 16 Jul 2024 at 12:36, Akihiko Odaki <akihiko.odaki@xxxxxxxxxx> wrote: > > On 2024/07/16 20:32, Peter Maydell wrote: > > On Tue, 16 Jul 2024 at 09:28, Akihiko Odaki <akihiko.odaki@xxxxxxxxxx> wrote: > > Before we do this we need to do something to forbid setting > > the pmu property to true on CPUs which don't have it. That is: > > > > * for CPUs which do have a PMU, we should default to present, and > > allow the user to turn it on and off with pmu=on/off > > * for CPUs which do not have a PMU, we should not let the user > > turn it on and off (either by not providing the property, or > > else by making the property-set method raise an error, or by > > having realize detect the discrepancy and raise an error) > > I don't think there is any reason to prohibit adding a PMU to a CPU that > doesn't have when you allow to remove one. For example, neoverse-v1 > should always have PMU in the real world. For example, the Cortex-M3 doesn't have a PMU anything like the A-profile one, so we shouldn't allow the user to set pmu=on. The Arm1176 doesn't have a PMU like the one we emulate, so we shouldn't allow the user to turn it on. All the CPUs where it is reasonable and architecturally valid to have a PMU set the ARM_FEATURE_PMU bit, so there (by design) is no CPU where that bit isn't set by default but could reasonably be enabled by the user. Conversely, the PMUv3 is architecturally optional, so it's not unreasonable to allow the user to disable it even if the real-hardware Neoverse-V1 doesn't provide that as a config option in the RTL. thanks -- PMM