From patchwork Mon Jun 19 14:23:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 694017 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp2399213wru; Mon, 19 Jun 2023 07:25:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6EmeCmONNFWLVeBlhC0ObiSc40TXCTWvGXWVErlT4lI5JJga3qafxry8zs5eiW6CQe2TNY X-Received: by 2002:ac8:5796:0:b0:3f5:2582:65d1 with SMTP id v22-20020ac85796000000b003f5258265d1mr12983063qta.37.1687184718498; Mon, 19 Jun 2023 07:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687184718; cv=none; d=google.com; s=arc-20160816; b=FW0XZ+ctLGT4TjTj8rzyprLX+PkpusOYTBH2yg6MGzFlViH9oMyZosv9RlftfXsw8B zhKALR8XawK+htPT4vL+B913uH9PFxAcG7u5Q4xsj2J3m9MepnisUukPu+36hrPkKTXw AECad3uX33ilYHdnwwmJ6+8zvu0yl/iG0tX2ntMgv/37z9O0bUIEEcn9FqLNoub3bG1p O+D+UsmTk5jVG5ySIPFcFwUaj5hnNq4Taa1Odq1qzBJZ8UYJk7Jx6nNZkDhI0lbeQP2Q fQqVctqFo//CPtFS5YChl+w5A+M8PICPMCpC9E1XOmNVZhF6fk3uf2+6cXQGMY+1sf6n r2fQ== 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:to:from :dkim-signature; bh=xizQ7tZRgd5GaOFhlyM3OwuFvyke8QeFNMuDXQV/YyE=; b=UvMj3fShQlok8jHMepl2LuwGe0KUJBAfAEv8FkR9xr5K0vL6jHQB38PA8wlUO8xhGe tme5/8xo8cT4BNg03KtAQ1QGamcNDM6v2Co4fd8qEmKjFr+oXhiTpbXIn3NT2YTrNUED kGh7ZTtSYK0UZzD+de0hKPwzLVTDpXorFvbnp7ZZHuZ91zbXaf4L2AogpvKS22s49JRk cHBQbSo3YdeaWlg4O6uT0WA3ohTGn2qL2MFcQ/wXjLdS1arK9rvwlgVDaTyEV7+r6H+o BcHUu5XQOZksaaqa/zjwpQC/fnf7G1MA2L0Ep7w4l/WsUYUbdO/51HjQLVAToygt4wng MLVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KBBmwaTU; 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 g20-20020ac87f54000000b003ff222a2c04si226883qtk.687.2023.06.19.07.25.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Jun 2023 07:25:18 -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=KBBmwaTU; 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 1qBFnL-0004Fs-3o; Mon, 19 Jun 2023 10:23:51 -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 1qBFnI-0004ER-18 for qemu-devel@nongnu.org; Mon, 19 Jun 2023 10:23:48 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBFnF-0000lk-F9 for qemu-devel@nongnu.org; Mon, 19 Jun 2023 10:23:47 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f9b258f3a2so8550605e9.0 for ; Mon, 19 Jun 2023 07:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687184624; x=1689776624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xizQ7tZRgd5GaOFhlyM3OwuFvyke8QeFNMuDXQV/YyE=; b=KBBmwaTULmC/6FtqOs1WxnJemAB7IsMFoe4IfnKjDx+dYXr1PlTDwU3oeI5HEBC/nd OaAd+9m6j7OOt2rEd57UMp+6etvW3gOWB323fZxzQkXqsECEE1HN494Y/cWJHh68DjaY 63lKrXAK38nE5KQN7LnwTRRLAwYweBtN4NkksGtiSTWbpM4DT70m8EUfdG9nD6wirq6y s+ltsuPIxcXy/xrra8w9P8ZgOAPLzM42Ccowi0mN213wrUh07HXavfO5I+FebHwFORVY 9O4bAw5mhctteAsyVQb9O1JAGB6QmgAPXmOMw/hhbpdpmbbeEO67fCwjQFFA+ga2wVLG 8uiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687184624; x=1689776624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xizQ7tZRgd5GaOFhlyM3OwuFvyke8QeFNMuDXQV/YyE=; b=kPIlxqNGWVU0dplrBjmJV+anNmjEyzTZ7P3KNXkDgHS0+JMYMj7/PJXyjrR899f5fB eXkL19PpF/RN6qJWOZYTaeTM7PBDVM9b9zX9sxXBWCSLU31UtAGjC6gYcqlxWpSGaiXs P9qCqTapWVSQ7mGJj/D2iE0xHOMaU3gmrMRKlFugNwPs2Sr9Gc0UTajgtXV2DzvuVkd0 l7EoT2qvNOsW19QmTy6jE0wQqqd76L724riZIHFCLXSOobUFQopwukyW2JmLys2fjOc0 oTt2gIde7TwmvhROp3kCkFLPma7zx2pIun8Y9Y8AlZCV/VE3SzJ9tdc+aZH+aE0pVNnr i6ow== X-Gm-Message-State: AC+VfDzp5x4D6LxpAN+brXzdxAz3o0yKmtoNSZRiURzTZGVFq0CcQjlY cE88h4kSD2hAFR+kGWKft+ZYUyvTGB7R5fUimKSTINiX X-Received: by 2002:a05:600c:2313:b0:3f7:f884:7be4 with SMTP id 19-20020a05600c231300b003f7f8847be4mr11046556wmo.21.1687184624130; Mon, 19 Jun 2023 07:23:44 -0700 (PDT) Received: from stoup.lan (sar95-h02-176-184-10-225.dsl.sta.abo.bbox.fr. [176.184.10.225]) by smtp.gmail.com with ESMTPSA id k25-20020a7bc419000000b003f96d10eafbsm4143467wmi.12.2023.06.19.07.23.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 07:23:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 5/5] accel/tcg: Remove check_tcg_memory_orders_compatible Date: Mon, 19 Jun 2023 16:23:33 +0200 Message-Id: <20230619142333.429028-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619142333.429028-1-richard.henderson@linaro.org> References: <20230619142333.429028-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32c.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=ham 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 We now issue host memory barriers to match the guest memory order. Continue to disable MTTCG only if the guest has not been ported. Signed-off-by: Richard Henderson --- accel/tcg/tcg-all.c | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 02af6a2891..03dfd67e9e 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -64,37 +64,23 @@ DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE, * they can set the appropriate CONFIG flags in ${target}-softmmu.mak * * Once a guest architecture has been converted to the new primitives - * there are two remaining limitations to check. - * - * - The guest can't be oversized (e.g. 64 bit guest on 32 bit host) - * - The host must have a stronger memory order than the guest - * - * It may be possible in future to support strong guests on weak hosts - * but that will require tagging all load/stores in a guest with their - * implicit memory order requirements which would likely slow things - * down a lot. + * there is one remaining limitation to check: + * - The guest can't be oversized (e.g. 64 bit guest on 32 bit host) */ -static bool check_tcg_memory_orders_compatible(void) -{ -#if defined(TCG_GUEST_DEFAULT_MO) && defined(TCG_TARGET_DEFAULT_MO) - return (TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO) == 0; -#else - return false; -#endif -} - static bool default_mttcg_enabled(void) { if (icount_enabled() || TCG_OVERSIZED_GUEST) { return false; - } else { -#ifdef TARGET_SUPPORTS_MTTCG - return check_tcg_memory_orders_compatible(); -#else - return false; -#endif } +#ifdef TARGET_SUPPORTS_MTTCG +# ifndef TCG_GUEST_DEFAULT_MO +# error "TARGET_SUPPORTS_MTTCG without TCG_GUEST_DEFAULT_MO" +# endif + return true; +#else + return false; +#endif } static void tcg_accel_instance_init(Object *obj) @@ -162,11 +148,6 @@ static void tcg_set_thread(Object *obj, const char *value, Error **errp) warn_report("Guest not yet converted to MTTCG - " "you may get unexpected results"); #endif - if (!check_tcg_memory_orders_compatible()) { - warn_report("Guest expects a stronger memory ordering " - "than the host provides"); - error_printf("This may cause strange/hard to debug errors\n"); - } s->mttcg_enabled = true; } } else if (strcmp(value, "single") == 0) {