From patchwork Thu Jun 29 12:02:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 697683 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp4848742wrm; Thu, 29 Jun 2023 05:03:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XL4eApD8V01/i0ht6bvziOAUxOzbnI9FPFyzhuWsI2XLwTzit58euEfy54vD2SBK31n9f X-Received: by 2002:a05:6214:202c:b0:634:8a80:230a with SMTP id 12-20020a056214202c00b006348a80230amr21972547qvf.59.1688040200922; Thu, 29 Jun 2023 05:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688040200; cv=none; d=google.com; s=arc-20160816; b=vBCvyatTkWL5R76CLz0Namu3WhCsomIQ6laUVmsFIPYUSTSUdYxc8qeVtRv433MAcn v3dvPu4glEfkniA1XC6oK6DENfTGrUWBX1zxomBSXFlYZd5Norv7Qhehut9Hkmjs16Ld THkv9/kv+/gjkgxRyPHgs2C5qesDt3j/G41WYT9rTpccEsFG2xjCdMxqv/BhonRJIAx1 sse6XX9AO62z4+ZpR44uHGkdFmRfJs//sc8/3BQkPvl3GpaW5wAC3C/Zj9xfVhvh0UFQ 1ymsFsvtanHG24SU+C8J8r5IJ/3xPZPqsJU75+3eXwCtpzUUT29steBjevgE3xvLr+3G KzBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z4l1J8enWAobibO9WsPypgJKzhJVu5hQ9JLx6ngTgp4=; fh=Us34MjHfZgWHITvkRVnF0NYGHJ9TfViOY78z9294uwE=; b=CxE7UxLeW3BsUnT5jm+38Xk1ozq+S0gygdVu/lPK1WuR7OkUsZvsmZL5hW+S4V6HqI bPd/O+jXTsgkNNd2u+6qJqq2jhYK77KmUDnegKxe8C5eVCBHTO7BA7iZjMZ8lGoKlz5+ 93ERcukjVTePcvB2tTcP5zEsb3rVLtItAQrf97hSlPyhonzh/I0uYnHjSiCKUYHARVk0 vY5yclDV4PXXSH77lgz9SSraWCynVHCiO63VpxaOuROdIjZClH1EVXCAtvyuwQCmb1RN Mw2f/FU/A0K1cNMrH1zmvyITHU0JZKRcAlqKpBgYfLsC4xh5ExKNxJP9n31J5rC02T5s eDbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=koniqtd7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o13-20020ad45c8d000000b006287d6a6befsi6097084qvh.308.2023.06.29.05.03.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jun 2023 05:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=koniqtd7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEqMh-0002NB-TR; Thu, 29 Jun 2023 08:03:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEqMf-0002MM-GR for qemu-devel@nongnu.org; Thu, 29 Jun 2023 08:03:09 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEqMc-0005Gy-Sw for qemu-devel@nongnu.org; Thu, 29 Jun 2023 08:03:09 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fba545d743so6535085e9.0 for ; Thu, 29 Jun 2023 05:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688040185; x=1690632185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z4l1J8enWAobibO9WsPypgJKzhJVu5hQ9JLx6ngTgp4=; b=koniqtd7SYoVw2kQ/UzeNmfGub4mnhpycYG0PglTSTIJL/724C15kLS0UUoZb8IDf9 Ds2GPsYW4g6yzpMHvVBZVmsheYGUTp5cLOkz/Qlfk/RJnZjhRnjLHdDBnTvVpEaac184 9wAFOPJh46B1q1LOFwcva91yZUMvdgAqydXhM5pfyPISnfJbBdZKo4EH27IegYddLsWp lsl5AJeXeo8e3/i6eQFZGi7NCJQBiEO+avfbGqiwQzdDllFsY654HPKbsrg/6XlZcva/ 7OlMoGslc0G3PPUuh7OZ3tbs7tP6bZ2wu2ccWPCfojk/NwHrBJ8+xZJISC1hIgWOBbBv YmYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688040185; x=1690632185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z4l1J8enWAobibO9WsPypgJKzhJVu5hQ9JLx6ngTgp4=; b=C6O+Z6ZMo/1ss2cBnN95KYloQDyChfdw5SFMhtxV/wunt2WdYLzizeVQtPTyo04Ba6 NJuLpvOVDlSgWlPdeh/ONR3Sonz0+2iak2zRZNEVzMFj6ts0UauextVgOhfSiGMpRSoE sYN4qkLRAiNN92M1E8XHfi37O5VGkcU+Bpuy+94nXpKW8MymEqhJVCz4ke+KpzMqMSQt yMBZnSKyC1HASi7uJEN9WYPoH9WOl3OTIcfH4VvfmnfTSBXmZEdiGMuZJFuc91kmEHfK dkFkNZQiM4TINkEiTTKiGfC80SdxGuyFmMKpdv4MdDmLf2IVO4AhKTX3HYEY7y4dmMUc InGg== X-Gm-Message-State: AC+VfDzTP/XwSSyOMZVDxK476w4VwZrF9vfmbGHJPN175TZ0rzFFyNwg cQO5MxfM7p2PrMAF1U4Ksh7MaVtnI9IRMWyp1Yw= X-Received: by 2002:a7b:c041:0:b0:3f9:b748:ff3f with SMTP id u1-20020a7bc041000000b003f9b748ff3fmr24245529wmc.1.1688040185160; Thu, 29 Jun 2023 05:03:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.242]) by smtp.gmail.com with ESMTPSA id l6-20020a7bc446000000b003fba137857esm7709810wmi.14.2023.06.29.05.03.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jun 2023 05:03:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-riscv@nongnu.org, Bin Meng , Daniel Henrique Barboza , Richard Henderson , Yanan Wang , Alistair Francis , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Weiwei Li , Palmer Dabbelt , Eduardo Habkost , Liu Zhiwei , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 1/2] target/riscv: Check for CF_PARALLEL instead of qemu_tcg_mttcg_enabled Date: Thu, 29 Jun 2023 14:02:54 +0200 Message-Id: <20230629120255.85581-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230629120255.85581-1-philmd@linaro.org> References: <20230629120255.85581-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org A CPU knows whether MTTCG is enabled or not because it is reflected in its TCG flags via the CF_PARALLEL bit. Suggested-by: Alex Bennée Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 4035fe0e62..4dfa64af6a 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -473,7 +473,7 @@ static void rv64_veyron_v1_cpu_init(Object *obj) static void rv128_base_cpu_init(Object *obj) { - if (qemu_tcg_mttcg_enabled()) { + if (CPU(obj)->tcg_cflags & CF_PARALLEL) { /* Missing 128-bit aligned atomics */ error_report("128-bit RISC-V currently does not work with Multi " "Threaded TCG. Please use: -accel tcg,thread=single");