On 26/9/26 09:00, Yonggang Luo wrote:
Register the AArch64 host CPU when CONFIG_NITRO is set, matching
the existing initfn early-return for nitro_enabled().

- Add CONFIG_NITRO to the aarch64_cpus host type guard
- Treat nitro_enabled() like the other accels in realize
- Mention Nitro in the host-CPU realize error
- Set host_cpu_probe_failed instead of asserting when only Nitro
   is compiled in and it is not selected

Signed-off-by: Yonggang Luo <[email protected]>
---
  target/arm/cpu.c   | 5 +++--
  target/arm/cpu64.c | 5 +++--
  2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 090470da40a..c138c4c0587 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1835,8 +1835,9 @@ static void arm_cpu_realizefn(DeviceState *dev, Error 
**errp)
       * this is the first point where we can report it.
       */
      if (cpu->host_cpu_probe_failed) {
-        if (!kvm_enabled() && !hvf_enabled() && !whpx_enabled()) {
-            error_setg(errp, "The 'host' CPU type can only be used with KVM, HVF or 
WHPX");
+        if (!kvm_enabled() && !hvf_enabled() && !whpx_enabled() &&
+            !nitro_enabled()) {
+            error_setg(errp, "The 'host' CPU type can only be used with KVM, HVF, 
WHPX or Nitro");

if (!hwaccel_enabled()) { "'host' CPU type can only be used with hardware accelerator" } ?

          } else {
              error_setg(errp, "Failed to retrieve host CPU features");
          }


Reply via email to