From patchwork Sun Apr 28 22:14:41 2024 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: 792942 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1424202wrh; Sun, 28 Apr 2024 15:18:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpzAJOSeBo+JhM8IlKZagvpjcM7E6P6DxvrTErmcF5kxIPro+LMnZzUK55OwLF/wWpDrBPAmlF7AUBvPCVDk21 X-Google-Smtp-Source: AGHT+IE0yr9AMz6LPxbcAtV5jzWEsX907PZyWsipabSRu6I1mpv8QheZz2zxsbMDYx0aTYyZvfW1 X-Received: by 2002:a05:6359:65cc:b0:181:601f:d8f with SMTP id ym12-20020a05635965cc00b00181601f0d8fmr12576394rwb.2.1714342731373; Sun, 28 Apr 2024 15:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714342731; cv=none; d=google.com; s=arc-20160816; b=TH/RLXRQSFs8Z1oEA51JReraQh6RbPjxNCx6BFQDgsq1FFJDS+nqhxxKlXUVaVFfkb TL9SI0yK2U7tHm3kV1IvIE7NfULNNSmKQSe/c2YboKshKtNOUchc/M65SZNq1Qq7PJGl lUk6O0rBFWVBy/XPInaXJB243rNPdPFnm8MxUNGUOila/wNbpiEJc/YefWJYLNajWRVf W/Svli+vP+W2VI2ReHKrEr2zBAcneZS+KXjErSmIalIr03oAkXX9Z8JLKcC9QVB1g0h+ sLtkcn0K9Nj3Yumwk1dclNteCOHk/9mXbGcp+1fQTED4UKd8ILx9YFNzT0gVDZQn6m6P y5dQ== 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=h6EbUiH0Q23M0FjKSUv3qw/noMjcf2vJ04Bs/jaSM9I=; fh=+kTJNlX4d/Ktp/5WO5d77IkVGYcQ7tiev+NqB54rN/Q=; b=O0rRdpo5e3pFPa3TLXwtMcd0HETxhEMdJB6ttSf2SiYo/sPZPnmDabziI1BaulqAaS Z1ccyWuYRerevWHj9WMD4aheMTWVjjyTSimeC3KAbobwx4jac1vJgiMW54BA7a+FTc6x Uvx9eOgVVkpiG4B6s8GeZRzSoNhd1ZvEwgQbTWuMxBXCdbx5Wf4TMlUMcCS0wtqI52Jc E5CbkLniwFpn39EeQemciBU0qXtcgcHdHJMKNiZlqPrGzeTOJ0P06cq2Mz6ZPkX8OcYV xxyjEeRUjuenVjBNR+0U2gW2CQ9o3/ZzEFZXAlaatg+i5iUVkx0Dy2oBYPvUC4qV74GR Cp4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FbGoi/44"; 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 m2-20020ad45dc2000000b006a0b85bc31csi4671060qvh.303.2024.04.28.15.18.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 15:18:51 -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="FbGoi/44"; 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 1s1Cov-0000HN-4Z; Sun, 28 Apr 2024 18:16:29 -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 1s1Col-0008Fh-Nc for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:16:22 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1Coh-0005fy-RE for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:16:17 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a58ebdd8b64so112212566b.0 for ; Sun, 28 Apr 2024 15:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714342574; x=1714947374; 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=h6EbUiH0Q23M0FjKSUv3qw/noMjcf2vJ04Bs/jaSM9I=; b=FbGoi/44IKm7FwtF0l2gYiXnMQlnd6VEBLjOGqyueS2HoA1wVcZ0sv+s5wTembXKdB mIRgRwFpZuSHn8lL6KNWhjswy17JNDfh7owq9maHhSk0OTlCZ/ZbbcmoG+lfG3X4hy1P QsS6qcaawu5u4UogpM00i8rFjcrcuBTqTLFgjUo+A20J7mEJYTeUYgou26IlQJol/YKh jCtwLaHaTGQhbnn3cNQeh6fGHnuodrfqWpGqwRfw5hxE91ZmVj9OkKmiDSIHOIfR+nTz 2JbURZdP6V1xkT6oRBwZQjVRbuzeTbDAeXJfPKEIkkDFGoAqtWHNeQ3eq8E4mkF4+xw3 DP1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714342574; x=1714947374; 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=h6EbUiH0Q23M0FjKSUv3qw/noMjcf2vJ04Bs/jaSM9I=; b=QkqSgTLdFsxHOVzxifRvTy+9jKkvQW8X+dLTXhJD/pyKrG+jl9GvEljMUQXE9/1sDw uiCiuekYGq4WMjxwGixgCuJj0ASFXGe5zUw2xkjH1+3nfbo9c8lLS2uu7ZKa+tbUWt5X 7srWehsXjXo9JjrMWtbfLYo7i+PYfkJE0yS9a+Nv7VpIa7XcqoqZ+i2K4AibGFxdOvNx 3JqaOMUPb02twNSlvbYYdU9Sp2X4vCva3uzlM5+LoAUqAyISSEKeTyS/Pkz7CxOe6lHT MgRcvG8KvnhBOAfr75lGIvB0IS5NMsozR8bdL0xTIv6lgG2Tk4iSPzB6WqoMFumik004 HKlg== X-Gm-Message-State: AOJu0Yyugdjk1gjOmg+qockZNUdFu6hKTAjvCAVTFYgQFdbsSfeMbUEA j5sDTVRFDf6/56TNO7wsgw6vwxocmkDUPocJlKMxzAy6csEj1bwMQaocOJtHsAhcS+/Dp21DTMl S X-Received: by 2002:a17:906:470d:b0:a52:5925:2a31 with SMTP id y13-20020a170906470d00b00a5259252a31mr5118406ejq.29.1714342574107; Sun, 28 Apr 2024 15:16:14 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id dq16-20020a170907735000b00a524318c380sm13190910ejc.80.2024.04.28.15.16.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 15:16:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 15/24] accel/tcg: Restrict IcountDecr and CPUTLB to TCG Date: Mon, 29 Apr 2024 00:14:41 +0200 Message-ID: <20240428221450.26460-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240428221450.26460-1-philmd@linaro.org> References: <20240428221450.26460-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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 IcountDecr union, the CPUTLB* structures and the "exec/tlb-common.h" header are only required for TCG. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Richard Henderson --- include/exec/tlb-common.h | 4 ++++ include/hw/core/cpu.h | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/exec/tlb-common.h b/include/exec/tlb-common.h index dc5a5faa0b..a529c9f056 100644 --- a/include/exec/tlb-common.h +++ b/include/exec/tlb-common.h @@ -19,6 +19,10 @@ #ifndef EXEC_TLB_COMMON_H #define EXEC_TLB_COMMON_H 1 +#ifndef CONFIG_TCG +#error Can only include this header with TCG +#endif + #define CPU_TLB_ENTRY_BITS 5 /* Minimalized TLB entry for use by TCG fast path. */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index ef8b85b6fe..dc28920bcc 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -27,7 +27,6 @@ #include "exec/vaddr.h" #include "exec/memattrs.h" #include "exec/mmu-access-type.h" -#include "exec/tlb-common.h" #include "qapi/qapi-types-run-state.h" #include "qemu/bitmap.h" #include "qemu/rcu_queue.h" @@ -256,6 +255,9 @@ typedef struct CPUTLBEntryFull { } extra; } CPUTLBEntryFull; +#ifdef CONFIG_TCG +#include "exec/tlb-common.h" + /* * Data elements that are per MMU mode, minus the bits accessed by * the TCG fast path. @@ -311,11 +313,9 @@ typedef struct CPUTLBCommon { * negative offsets are at the end of the struct. */ typedef struct CPUTLB { -#ifdef CONFIG_TCG CPUTLBCommon c; CPUTLBDesc d[NB_MMU_MODES]; CPUTLBDescFast f[NB_MMU_MODES]; -#endif } CPUTLB; /* @@ -337,6 +337,7 @@ typedef union IcountDecr { #endif } u16; } IcountDecr; +#endif /** * CPUNegativeOffsetState: Elements of CPUState most efficiently accessed @@ -346,6 +347,7 @@ typedef union IcountDecr { * @plugin_state: per-CPU plugin state */ typedef struct CPUNegativeOffsetState { +#ifdef CONFIG_TCG CPUTLB tlb; #ifdef CONFIG_PLUGIN /* @@ -356,6 +358,7 @@ typedef struct CPUNegativeOffsetState { #endif IcountDecr icount_decr; bool can_do_io; +#endif } CPUNegativeOffsetState; struct KVMState;