From patchwork Tue Dec 12 12:33:37 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: 753059 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1875297wrs; Tue, 12 Dec 2023 04:35:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFV/mTnZw3DNTKeDXNuEsEvbOBOGPEPZEJbfAjEHZYwLPz9cZhmbY1bOl9fzCdQk3oLFgqZ X-Received: by 2002:a05:6214:5195:b0:67a:d843:e0d8 with SMTP id kl21-20020a056214519500b0067ad843e0d8mr9750766qvb.18.1702384539719; Tue, 12 Dec 2023 04:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702384539; cv=none; d=google.com; s=arc-20160816; b=aCahSPv8jd37IBT4x9jnAMJ+0LLQGetuLH7HsaTMapG+Waxh+8u7pFqc9Sxs3C/kAS 5QqIWaLBOu47IZvohn5MMfnINLiqKi2uiGgAVMAYCgO7lL/NdOClf8TJGOiweFWo/1hE JHsM1s+71xrlHhcDuzK9pHv5QZIXsFEs9znAHNlHoeSrBLA2PwRL1UhmufKsOZ9wb+HP IwBlDDN60aNt6eiBH2Dcw6fga0OtEyMvE/AZpeJ9TkqwQUEByYh56xCdoyQkRNvGBcli ckPPfWFSvuhX1798P3esIRw9ojz6qDpt8EqdS+8M1euvHkqCyMAdHPxgKy0zNzHZrwah R2Qw== 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=ek5eH89m6U4onfJDQbwgikjGRZL4xGCW1/xN2ORw4ro=; fh=vlFEGdij83GYetLrOUaCnR04sbYRvtckD5L7fw5192c=; b=rgMDinNgWngFvpTMQxrZdvZ3e4YiRDiwfACu1T+RhMR1u72y45E0IEVDGCV5W0knBO MXDN4PAV+jfLfkerFC9pAcn+U7dBEmBV9oXhSYlhtHdq0wUGsU35TKhNlJyb21U2mA1Q 65I5Vlp6oUBggDIeF6U75CjhFakXLcQiqBZnp+aFV866DZZSWsnFAGRNztOFbmyr4zxQ TMJZ+78KiqgTU2AyfzBiyf/gxaOaaDCfIHuHuhJjiJ8gNmiXRRY/EG/WQuvZgrI3pmwL sG3kGp8WyGOVWNXxvIszJ4Nr/GZ+BQBE9XNEV2bAIbz9PicNsWWxbAnpH0jVVhal4PIy XSbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xGuCP10w; 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 h17-20020a0cedb1000000b0067abd49378csi10568908qvr.354.2023.12.12.04.35.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:35:39 -0800 (PST) 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=xGuCP10w; 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 1rD1xp-0007Xn-TT; Tue, 12 Dec 2023 07:34:17 -0500 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 1rD1xo-0007WJ-CZ for qemu-devel@nongnu.org; Tue, 12 Dec 2023 07:34:16 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rD1xl-0006ak-O5 for qemu-devel@nongnu.org; Tue, 12 Dec 2023 07:34:16 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-54c70c70952so7938959a12.3 for ; Tue, 12 Dec 2023 04:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702384452; x=1702989252; 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=ek5eH89m6U4onfJDQbwgikjGRZL4xGCW1/xN2ORw4ro=; b=xGuCP10wN5A69z4IkUoYupDOd4e40T2kgKc1SuEJyHIr1ZXW5H36fR7vqBBZKsYRTU gU0D5md/mABDfvfbHL8dnowwweP5YmElSNL02B94ihzUyZwZvs4uCq5g+ZMv29/Ty+yT VpmgaKh4QmU0skTRXSjRSqHFt6vym8vmrn9fhDOxw2RCcBUf5/eK4AAl9UGhE9q4ENYk OLsnxV/PmFlivkpWr1uPn7/OcYbGzW3rmQ2JRLenJ3nrRr5C/zcbfWySR8j3vNdIE+p8 Cl+xMihwmzR9gfNrz0jyDL/87fj1BGEqj+9s41EuD8W6JxcnPk2WYuuzqK1sdExQZzDr 2bqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702384452; x=1702989252; 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=ek5eH89m6U4onfJDQbwgikjGRZL4xGCW1/xN2ORw4ro=; b=W4vvzcTf4NMUlRWmdnOLC1PiCAvH6C/jCmgZ1zLCH/j5AYjZdzT/dKh3PUWeMKeFt8 DkDjSTt7qR6F7HgKtB4Re1T9HGSStZsF4PuOkb8HmZuSDF0NFOwR5QuYXen/6cfPcPHj 9w2s44I25/RX98KXuQce7cPMFBRSU0ZLFyBOTIyWRAGttNP79TWaJLJ3R0XadcKY9rnP wBFK/udMOtMZqvENdwaVdGbPhDUtVEUkV5WIRByFJ0UrBgwK1jJ9megNXRpiO6CjDdL8 pdQIg9fPqSEyuoJtxMc5cMNr+lrjxqiRMCvOqpA0hyLONejgk+KEaKJ6uxH2jxH3BPsy vDtA== X-Gm-Message-State: AOJu0YzYoJwgJCHQ539XF7ro1/sF+QVsMYxihTaXzyX0hnCiCHB/Di43 t11Z4IqRcS89Dh3syRCYA22t9O1lP6tx/YPYFsFjOw== X-Received: by 2002:a17:906:e294:b0:a19:a19b:421e with SMTP id gg20-20020a170906e29400b00a19a19b421emr2004022ejb.137.1702384451860; Tue, 12 Dec 2023 04:34:11 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.193]) by smtp.gmail.com with ESMTPSA id uv6-20020a170907cf4600b00a1e443bc037sm6274678ejc.147.2023.12.12.04.34.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Dec 2023 04:34:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Claudio Fontana , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Richard Henderson , qemu-riscv@nongnu.org, Brian Cain , Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Manos Pitsidianakis , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , Warner Losh , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 01/23] exec: Include 'cpu.h' before validating CPUArchState placement Date: Tue, 12 Dec 2023 13:33:37 +0100 Message-ID: <20231212123401.37493-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231212123401.37493-1-philmd@linaro.org> References: <20231212123401.37493-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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 CPUArchState 'env' field is defined within the ArchCPU structure, so we need to include each target "cpu.h" header which defines it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Warner Losh --- include/exec/cpu-all.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 5340907cfd..9a7b5737d3 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -411,10 +411,6 @@ static inline bool tlb_hit(uint64_t tlb_addr, vaddr addr) /* accel/tcg/cpu-exec.c */ int cpu_exec(CPUState *cpu); -/* Validate correct placement of CPUArchState. */ -QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0); -QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState)); - /** * env_archcpu(env) * @env: The architecture environment @@ -437,4 +433,9 @@ static inline CPUState *env_cpu(CPUArchState *env) return (void *)env - sizeof(CPUState); } +/* Validate correct placement of CPUArchState. */ +#include "cpu.h" +QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0); +QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState)); + #endif /* CPU_ALL_H */