From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09ED9C4332F for ; Mon, 11 Dec 2023 21:25:55 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCnhi-0000hx-Pm; Mon, 11 Dec 2023 16:20:42 -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 1rCnhg-0000gj-88 for qemu-devel@nongnu.org; Mon, 11 Dec 2023 16:20:40 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCnhM-0005CC-Nl for qemu-devel@nongnu.org; Mon, 11 Dec 2023 16:20:36 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3333b46f26aso4702582f8f.1 for ; Mon, 11 Dec 2023 13:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702329618; x=1702934418; 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=+O6qsD4iSikKX7LlQ9zhnH8XNtR1+Zg+F3UQkLugJvM=; b=xjhepvAcZyeTjITanX2UP/ql6SdyZHBfxcRYpFDCCwFrcIiS1g6UVzpcO6pm2LFJ8k EnJpjOsVK8Pfqn+Gv8YloNi1nVkiWgmgmPRSjyTqtk75r+2QTF7rXfU5SQWulO88yqJf +r1xtiGWBVu9KM/+cTA35W7DucBMJhuRmWh5fLplDpc0kWKa2msuCjqSUbJD9y72CR62 mRTPZpfE4y6b1tqMG3KkxKSGko6cKr8ynIcSxlinWZlOfx7fehmYxpvZgeVWZnUFVgXu E9koTyumZ11/MlBWtCOzJxpBVnAeOoTLdzrXsmhios/hfTHAStdLjVJjTXIF4TJCb/l4 dcZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702329618; x=1702934418; 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=+O6qsD4iSikKX7LlQ9zhnH8XNtR1+Zg+F3UQkLugJvM=; b=vIN0jQ+k/qDCunXUce3OYubq0OKtrBnkZpXjQbJnTTAMYb+e0OZ22of2uk2w6IUG98 HSzmANKO3jWR1orjQX4SzEclhpnLUMVA9Kpd8yRdlYTdWL2QCRUrulvC6fUvDCb6Tq9y Z9QpsyC8nuaILA6e6LVRv5mCvFYyEPR4ZIWfWrws+eoVhBqXRchmK7ElH5ebegkbwFbg x9ZhGuB0qlUV9bSYBWVVprYv5EDtR+nMroWlsfzjNaWMQWj3OWsLUMHAgota10k0trCb UNZ2gI0b4KQwoZMP5bRjtxi2VDtWrrJdjm2jnjzmrxe7Jfg1iNXaHvH8uYx9UA/Blgfq kIJw== X-Gm-Message-State: AOJu0Ywp0tCZyOPxhDkDeG/P0iWvcYTNhlQ3bSmCxuo4a5hauxBZqrDV M5tG9a9ac4kVuDyryn6IjkmUsXTFs3PCnNuWRYIdzQ== X-Google-Smtp-Source: AGHT+IEGytrQy7Ystfv6RnhfSOauiZ+iRUKsQm3VCDpsIUm30ILiQ4RfEMueOEJ4nTVHKHcn3ji8CQ== X-Received: by 2002:a5d:4d8e:0:b0:334:b24d:c18 with SMTP id b14-20020a5d4d8e000000b00334b24d0c18mr2975705wru.2.1702329617610; Mon, 11 Dec 2023 13:20:17 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.193]) by smtp.gmail.com with ESMTPSA id le9-20020a170907170900b00a1e2aa3d090sm5264476ejc.206.2023.12.11.13.20.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 Dec 2023 13:20:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Peter Xu , Liu Zhiwei , Peter Maydell , Mark Cave-Ayland , Eduardo Habkost , qemu-arm@nongnu.org, Paolo Bonzini , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-riscv@nongnu.org, David Hildenbrand , Warner Losh , Claudio Fontana , Brian Cain , Daniel Henrique Barboza , Richard Henderson , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 01/24] exec: Include 'cpu.h' before validating CPUArchState placement Date: Mon, 11 Dec 2023 22:19:38 +0100 Message-ID: <20231211212003.21686-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211212003.21686-1-philmd@linaro.org> References: <20231211212003.21686-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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é --- 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 */ -- 2.41.0