On 3/18/21 1:08 PM, Andrew Jones wrote: > On Thu, Mar 18, 2021 at 12:32:30PM +0100, Claudio Fontana wrote: >> And why do we have a separate arm_cpu_finalize_features()? > > Separate, because it's not just called from arm_cpu_realizefn().
In particular it is also called by the monitor.c in qmp_query_cpu_model_expansion(), which basically creates an object of the cpu subclass, and then calls arm_cpu_finalize_[features]() explicitly on the object. Is the qdev realize() method not called in this case? Should instead it be triggered, rather than initializing/realizing an incomplete object? > >> >> Nothing in the ARM cpu classes initializations ever seems to be "final" to >> me. > > Some CPU features cannot be simply switched on/off at the property > parse time. For example, there could be dependencies on multiple > properties, the mutual exclusion of properties, or other aspects > that can only be known later than property parse time. That stuff > goes in arm_cpu_finalize_features(). Seems like _part_ of that is in arm_cpu_finalize_[features]() (in practice, this ends up being AARCH64-only stuff, ie SVE, PAUTH and KVM). After calling that, the arm realizefn() also does further setting and unsetting of features, checking previous feature states. There is a whole lot following the arm_cpu_finalize_[features]() call, there are ~300 lines of features initializations happening _after_ the call to arm_cpu_finalize_[features](). > > Thanks, > drew >