From patchwork Fri Mar 21 12:57:36 2025 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: 875237 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp850697wrb; Fri, 21 Mar 2025 05:58:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/IKLtm0oLagPPPfe5/9WSPJoMc+JewQnVb+8p0wGq7NkZGbPoQ8INHDnTJv525DNkx+U9fg==@linaro.org X-Google-Smtp-Source: AGHT+IFedkEJpnWYd2gPboucX4OAKdbgt50QPZMrQ2vK5wOeoCkHJ50Yt9MZ5XyHPOOygKnKqweP X-Received: by 2002:a05:622a:260b:b0:477:c89:3813 with SMTP id d75a77b69052e-4771dd62403mr39627941cf.9.1742561935430; Fri, 21 Mar 2025 05:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742561935; cv=none; d=google.com; s=arc-20240605; b=iPN4vJqjEEdPQ67PA94ZTXwj0LeAWz0/qvvDPiHXrLSglW4iJ9rUo5JAHNQRKc4beL faxs13r/0DDG0o9an8w4EGrynu8FDLt4WsBncY1SU85kcn+JtY+/5UDtwnV/zvwnllRt Q4aHqRXkcz3WTarJH84M0FzFeWPN0Oh6LdpDrTHzFl9aywQl8EL+SH5Be31jF34EvkiJ 5rfBZzMFvSSExtGnT7J3saBWkS89glY0yK40JZlVrKrVdsbWNjoi7u7b7HuNTdGPaB4V WSldM3UY+juaWbaNyff0hta5nDe+/f1wt8s5CPMbXXMy8/g9DtInyHJ2hEPxRnUhXSMD sXEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=VI0tJYTkCb6gsC09E2J8+oKikCYS17hZ29QKB1qjUsQ=; fh=6KR989Wp7QU5PJHl1R8iq8ouoTta8oEk/HyvGTu7KLY=; b=RmvqGTG22roeo0IzeUdlMGbeewNVF8L7hHJrFkQtQfQ/LvaAc+VWeXkpr17SiigzYt sRMMoL0McUY2qkpuBo7X4kkCHJGzC0hPk7iw/wrWw1CRY8fQy5agZqziAV4SikbufjjX t+7ecP9bMSgy25Q1Cf1N5UOB+QBHtGKVcPAZkPP2yXNDo+QkRK2uyrVCHr+eIexZ1OGb /aH/XfbsPvWjqFgRTWDaiRwGuRoxpCsHIwezy/RmJIAhmNfb0nheqywM2jaA8D11vomi 2mglVEMcNeMXQ93XrbKN7km/Y5cZViRVdEfWKl0rZy/E0on03gYUhE5U7BrZX5VWqjNQ r1Rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gt+11wjY; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4771d1801cfsi19093761cf.184.2025.03.21.05.58.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Mar 2025 05:58:55 -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=Gt+11wjY; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tvbwn-0007lO-BR; Fri, 21 Mar 2025 08:58:01 -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 1tvbwj-0007kC-7X for qemu-devel@nongnu.org; Fri, 21 Mar 2025 08:57:57 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tvbwh-00031A-NI for qemu-devel@nongnu.org; Fri, 21 Mar 2025 08:57:56 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-399737f4fa4so1197624f8f.0 for ; Fri, 21 Mar 2025 05:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742561874; x=1743166674; darn=nongnu.org; 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=VI0tJYTkCb6gsC09E2J8+oKikCYS17hZ29QKB1qjUsQ=; b=Gt+11wjYIqVNjFfdRobtxCVUHAWaY0MvTUYSyxzk34LmgdtZOY77q5gWyxy/dyXjOh 4QKwGpPjC1/MMJ+dTkkqBDrTOJCuHODyfWFFwhNWmZ+gVnB38YPMAAkUryS1HJXJ1sow Uu+uclkSMkNcQxC1fYh9Ixp7/+AkMhl7d9zMQaqV3FSwfULINC+LM+osFOQ5b+s3c0JD 19szF+Elcb1Qzxqh/ru0wtSggoWvJvVP6E4kGNGOFjQV+MDRBzfLVaxDQ3yMc327ZTa9 cY5HQzzoj5MkbaCg6heH3ZOEPs2MnUBc8788zJ/tjPRHuBb/hlVw9NplGxCUdUA2GvN2 pWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742561874; x=1743166674; 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=VI0tJYTkCb6gsC09E2J8+oKikCYS17hZ29QKB1qjUsQ=; b=vcY1x0sgYSXebZh9fiLANy5KeogbwR0Zu7cQa27/K3ZRHE0OV8aKDo1ckA6ek3HE1I anQtMT/dy7ZEWpxlO9GIDswOfB6K3PQmiNTZPP80c+T6WDUMU+r0UETux74cY1/NZ9ap MWoP116hovh6R9K0USOYZVXfzvOZPPTQ7AOlXluSZaVXSvxgoX5520RAHO0XWHBXHTwZ +Y6yvjId4dTnn+ibPwH2x1WUSre4Aj6413uNMuzqIWdB5/qCEhRJFCB7H8e8Wq6rFSTX vVCaMq6p7wRFWJP8lUbnEZkWVb0EPeUKg8eOVEt+AWPMJebc3dkw3JX1KjNVxqUrdjPK LrJA== X-Forwarded-Encrypted: i=1; AJvYcCWbNYh1mqApt/rG6ZDEDdvqTX+n5X9ixj/pwaVK/amjdBqeFBOvR5zUL2Y/57Xri9G5AMQIfT5c9cs+@nongnu.org X-Gm-Message-State: AOJu0YxBMiMbCeKKPQYh/hV8vVRY5djwB/lD8P2az080shWLYvr5J5uE RUK67a8CWhw/I7vWu98zIY3gjQ4vwGZKUlJF5tv+AnLMjVkZk+78WF9sqEEb3bQ= X-Gm-Gg: ASbGncuCc6WvlHWT6uWqKvZK+sCDi7JgLFU2O6Jr7x3sRULQZ2W55rPcsrPedgFuxz8 KhPbt48kQFg5e49kqPiQKncGpzyG3hWZmtEackAnwD46/EJUvBZdz1RNtltVWCNXo0LFiaQ0G9X paAH9RabJYu4w/wYglbkgYw3cLHrwa6osc4ENr3/4UNNpgvoZFPyypSyHKIsAUtFA3/m2NX6ilf +xgL1+dRVyI5LFxZWq8lBgEb/ShtTW/rAHTK54UfVe0WTxHdoG0AWPIlsslhVcnCKMc3pnqzHM+ Ke5TVS47ohVQmpaLG7khA34T9WKFEul4dkAH+aRTauSRw2AlkOBZ5UdTvieVdcAw5BBFnkDtYFB 0GpNuNlhchYBdunaZNa8= X-Received: by 2002:a5d:5f8b:0:b0:38f:231a:635e with SMTP id ffacd0b85a97d-3997f912722mr3297314f8f.25.1742561873979; Fri, 21 Mar 2025 05:57:53 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6539sm2305615f8f.77.2025.03.21.05.57.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 21 Mar 2025 05:57:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Richard Henderson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-10.1 3/4] tcg: Have tcg_req_mo() use runtime TCGContext::guest_mo Date: Fri, 21 Mar 2025 13:57:36 +0100 Message-ID: <20250321125737.72839-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250321125737.72839-1-philmd@linaro.org> References: <20250321125737.72839-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 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 In order to use TCG with multiple targets, replace the compile time use of TCG_GUEST_DEFAULT_MO by a runtime access to tcg_ctx->guest_mo. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-target.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index 1cb35dba99e..014ee756f9d 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -49,11 +49,9 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); * Filter @type to the barrier that is required for the guest * memory ordering vs the host memory ordering. A non-zero * result indicates that some barrier is required. - * - * This is a macro so that it's constant even without optimization. */ #define tcg_req_mo(type) \ - ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO) + ((type) & tcg_ctx->guest_mo & ~TCG_TARGET_DEFAULT_MO) /** * cpu_req_mo: