On Fri, 27 Nov 2020 at 16:47, Eduardo Habkost <ehabk...@redhat.com> wrote: > Do you know how the implicitly-accelerator-specific code is > implemented? PARange is in id_aa64mmfr0, correct? I don't see > any accel-specific code for initializing id_aa64mmfr0.
For TCG, the value of id_aa64mmfr0 is set by the per-cpu init functions aarch64_a57_initfn(), aarch64_a72_initfn(), etc. For KVM, if we're using "-cpu cortex-a53" or "-cpu cortex-a57" these only work if the host CPU really is an A53 or A57, in which case the reset value set by the initfn is correct. In the more usual case of "-cpu host", we ask the kernel for the ID register values in kvm_arm_get_host_cpu_features(), which is part of the implementation of kvm_arm_set_cpu_features_from_host(), which gets called in aarch64_max_initfn() (inside a kvm_enabled() conditional). So there is a *_enabled() check involved, which I hadn't realised until I worked back up to where this stuff is called. thanks -- PMM