From nobody Tue Nov 4 21:57:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530897525520708.5733651895979; Fri, 6 Jul 2018 10:18:45 -0700 (PDT) Received: from localhost ([::1]:59010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUNX-0003Ni-Qr for importer@patchew.org; Fri, 06 Jul 2018 13:18:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUK4-0001D6-7n for qemu-devel@nongnu.org; Fri, 06 Jul 2018 13:15:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbUK2-0000lo-Lb for qemu-devel@nongnu.org; Fri, 06 Jul 2018 13:15:08 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbUK2-0000lZ-DK for qemu-devel@nongnu.org; Fri, 06 Jul 2018 13:15:06 -0400 Received: by mail-wm0-x244.google.com with SMTP id v3-v6so11526944wmh.0 for ; Fri, 06 Jul 2018 10:15:06 -0700 (PDT) Received: from 640k.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id h40-v6sm13784683wrf.40.2018.07.06.10.15.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 10:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=DwRVBNuFbiCYw7FLXGfWLmoc3QWixbhcKkDTANVr+/g=; b=jEof/3tNTAdJcf2digLTdXcxj6tdqAR0YKSuRulxuEC+Xh99bgkOkOqmyiUfZe2jJi QqzcjGX7J3WJ+rHAseQ1AiZg5bcsfql9EW7by/T4vIH/t8hqaki6KEcvKA2VZKotCTmG RDX9yNjBt9uJK77DH0PBgdGuQ9Hzt/4QReEDVIqfhGb/LBmCeU0N7PcStymQv6GwicmR Z3SCus0Tc1/jzRmT34rSPY3qs5ImO+QzcTp0X76ObMBYU+MrmvsPfNiffEoNs5ZnfcUv 3xiJP2WopcXWMyt16cX/hGRaznPAh9P0MGNVYiq7Ib0g/+FUz3mTwzzM76Vz7iUQjBmF LFig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=DwRVBNuFbiCYw7FLXGfWLmoc3QWixbhcKkDTANVr+/g=; b=PunpDZAzTZFvlmYwp0wuULAfaC0ftd8z6LsZuNKWULlgu4lVo2FY7GHyoW9/XFIlWN lFA++soAMd+9TfboAauXm4SwMTr3++H6fPKR2ug9NpDBaL6aY7GI+2yhFQznXHtTyP8R B7E2kwyr25ioSS88DUvp4RDSWiATNnS5k8Z+/I8Oqr0dL+jmViFHXsjfu0Pgr+PxI3wW MMNMtq7vDlM9zr/55Q4/Mg5DrwFcGtoYAftj4MaUFBBcfB9j/mK2sDjSDi6TfbJy3rBH t31HSWb11+uzix+UadvgwV+gtwghRtb11Jrx5hID1Lj0b8J1AB+sOwHfc62eTxEm2nhg SPuA== X-Gm-Message-State: APt69E2JM0AWZW3edCcC7vzNDTB+GEOoMw4KUk4/pTi276qpYOk/oPPO nyk4lEja0EUJF6qdgYe88Dv+l6NX X-Google-Smtp-Source: AAOMgpd+VUXgXDe72NFHPGrqxkSvtAIY8JIeckP1Hlk6hYjKMXdto3c9l+pO1DYU5lf1Xifp/YLL5A== X-Received: by 2002:a1c:1183:: with SMTP id 125-v6mr6914363wmr.138.1530897305238; Fri, 06 Jul 2018 10:15:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 6 Jul 2018 19:14:24 +0200 Message-Id: <1530897268-22932-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530897268-22932-1-git-send-email-pbonzini@redhat.com> References: <1530897268-22932-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 4/8] i386: fix '-cpu ?' output for host cpu type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz Since commit d6dcc5583e7, '-cpu ?' shows the description of the X86_CPU_TYPE_NAME("max") for the host CPU model: Enables all features supported by the accelerator in the current host instead of the expected: KVM processor with all supported host features or HVF processor with all supported host features This is caused by the early use of kvm_enabled() and hvf_enabled() in a class_init function. Since the accelerator isn't configured yet, both helpers return false unconditionally. A QEMU binary will only be compiled with one of these accelerators, not both. The appropriate description can thus be decided at build time. Signed-off-by: Greg Kurz Message-Id: <153055056654.212317.4697363278304826913.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b0b87c3..e0e2f2e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2836,13 +2836,13 @@ static void host_x86_cpu_class_init(ObjectClass *oc= , void *data) xcc->host_cpuid_required =3D true; xcc->ordering =3D 8; =20 - if (kvm_enabled()) { - xcc->model_description =3D - "KVM processor with all supported host features "; - } else if (hvf_enabled()) { - xcc->model_description =3D - "HVF processor with all supported host features "; - } +#if defined(CONFIG_KVM) + xcc->model_description =3D + "KVM processor with all supported host features "; +#elif defined(CONFIG_HVF) + xcc->model_description =3D + "HVF processor with all supported host features "; +#endif } =20 static const TypeInfo host_x86_cpu_type_info =3D { --=20 1.8.3.1