From nobody Thu Nov 13 03:18:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576514026; cv=none; d=zohomail.com; s=zohoarc; b=BizMG2FlmxLAJuAqX/ND4rvxQUq0ZggFqpd3cUVpuaTegeB7heBRRfg/0C1XsnlzjhXagNsjMViMaQ3oNcs+nihMrcV32IZa/7EsoN3Jn/X4WU4TVGTOzb7GGq2IvzzZVcWAEgi5EdnGD2fEBR/a9g+w9rZ2WFtA6fkMHx483oQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576514026; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yver+z01Ad2CgxbNm/G/S9DVzSw0YehnxQ3kmcrkoVo=; b=e9oxhG37I+w/p+c6ou02WN4SJJiyZIVB1y8SjwBn5MabKc89AEdUb0sNN4RkHYdKZweYBZic9zD1jtf5bATFGhec5krUoBg7GWKWpcwoikkA7gIqUPhiKuOdmZMvRJckQlYdiqV/F/UWDqErS0GukexLHzgj6/CxHpn9gopanuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576514026855587.1587629195596; Mon, 16 Dec 2019 08:33:46 -0800 (PST) Received: from localhost ([::1]:56618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtJZ-00020I-3F for importer@patchew.org; Mon, 16 Dec 2019 11:33:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56547) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtF0-0004p4-W9 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtEz-00079j-Sn for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:02 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:35180) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igtEz-00077r-MK for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:01 -0500 Received: by mail-wr1-x443.google.com with SMTP id g17so8052716wro.2 for ; Mon, 16 Dec 2019 08:29:01 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id q68sm19962334wme.14.2019.12.16.08.28.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 08:28:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yver+z01Ad2CgxbNm/G/S9DVzSw0YehnxQ3kmcrkoVo=; b=L0BClAhCSyj7NiBVh0sMJtEzUFZK85VVU38/wYVKdDVdhefHQdGIwh4rx0mkP8Z435 YVPr0/E1lSVvG0ITpi4dQ0sklCvSDcEZLGEhxVj2At6co0fWAE1IEBOq819Jy/NhpPc9 d/09MU5QfXvaUcG+Fv+hrrEv1jYHzzJOl4pESWPTgGKejsd5AZYZ+pCJS1GwprghIDIn e8OhJca5F04yHXVOgqci/m2jZvBEg00Noi2MBscFo9UX6cdYmqgGsCurf/wSfFgcI6LE hbNrF9jYz4Txu2GddjtIRRC40SIiv2tMIA4cJnQZsWs3RUvOcEH6vcesthRlqAtFJjIt KqFg== 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:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yver+z01Ad2CgxbNm/G/S9DVzSw0YehnxQ3kmcrkoVo=; b=d79YdxFTFSA09wmmeoFp0Gy9HufjGty77kxAsv4X1ySR2UAaZOdjxtzrHtYazizZm3 F9fVoe6BMlS7UjuIhQVqJpM/OHH+2uBLWJK+KHLYzv+TrfUTH6oNnJfCNor7IMKiusuY PHNSPuVNhwam8cNP13VhdLyiHYYV0UNc05rf8j291kFHbZ7Gm7MysWQosOXphd+0d6fJ /SqW5NaeMe5XUxxs4VCVUGB9sSr/zcS7KaEzT3K2bcgLxhrCNuKp7Xa2H5q3GTE/kLdq DwhqMvLgidQEpyZolh05DObwn9/CA0lIYqjPvsgZ3BeODigB7VnTmmpIjZlSJPLxxINF iMdA== X-Gm-Message-State: APjAAAUXYXZ3VRO+rVqctJp9HM3Wu4Fq758kcGwFF3nFAQ8/1BQgCb7c IYUjKkXLOBbNWwpYT6TyWevG3DRg X-Google-Smtp-Source: APXvYqzMAmaYY5Cenkkd+eTM7OvEIdizsYVw28ZUq6Et4+ethQ/b4Kl8bFhSVSjrxZ6uZzZi89qtlQ== X-Received: by 2002:a5d:6206:: with SMTP id y6mr30349052wru.130.1576513740437; Mon, 16 Dec 2019 08:29:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/62] vl: move icount configuration earlier Date: Mon, 16 Dec 2019 17:27:57 +0100 Message-Id: <1576513726-53700-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576513726-53700-1-git-send-email-pbonzini@redhat.com> References: <1576513726-53700-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Once qemu_tcg_configure is turned into a QOM property setter, it will not be able to set a default value for mttcg_enabled. Setting the default will move to the TCG instance_init function, which currently runs before "-icoun= t" is processed. However, it is harmless to do configure_icount for all accelerators; we will just fail later if a non-TCG accelerator is selected. So do that. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- vl.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vl.c b/vl.c index c0904b3..60353dc 100644 --- a/vl.c +++ b/vl.c @@ -2825,6 +2825,12 @@ static void user_register_global_props(void) global_init_func, NULL, NULL); } =20 +static int do_configure_icount(void *opaque, QemuOpts *opts, Error **errp) +{ + configure_icount(opts, errp); + return 0; +} + int main(int argc, char **argv, char **envp) { int i; @@ -4142,6 +4148,8 @@ int main(int argc, char **argv, char **envp) * Note: uses machine properties such as kernel-irqchip, must run * after machine_set_property(). */ + qemu_opts_foreach(qemu_find_opts("icount"), + do_configure_icount, NULL, &error_fatal); configure_accelerator(current_machine, argv[0]); =20 /* @@ -4227,13 +4235,9 @@ int main(int argc, char **argv, char **envp) qemu_spice_init(); =20 cpu_ticks_init(); - if (icount_opts) { - if (!tcg_enabled()) { - error_report("-icount is not allowed with hardware virtualizat= ion"); - exit(1); - } - configure_icount(icount_opts, &error_abort); - qemu_opts_del(icount_opts); + if (use_icount && !(tcg_enabled() || qtest_enabled())) { + error_report("-icount is not allowed with hardware virtualization"= ); + exit(1); } =20 if (tcg_enabled()) { --=20 1.8.3.1