From patchwork Mon Dec 11 21:19:56 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: 752548 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1549813wrs; Mon, 11 Dec 2023 13:29:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7XIYf3B6+KzfLWjIcGMKOCxHFDLFGoevJy1NW7yibYzGnwUw7J+cHtP6pzQ4t12ACHP7w X-Received: by 2002:ac8:5aca:0:b0:425:4043:7624 with SMTP id d10-20020ac85aca000000b0042540437624mr7321143qtd.76.1702330178559; Mon, 11 Dec 2023 13:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702330178; cv=none; d=google.com; s=arc-20160816; b=hYfLOFz37yC2LMlb0CNa1ESk+uoXE8oZylwyjtNZKP0RvqVkloEVdarSj1F1+oCgTm URb3y8SEK/sJVehXQCtphp9NZHx3UetmvAUx2SlHQGv7ls3Io4YfPV2GadiAo8s3/XKW slVEDCjzsGY5ldkFtVb0UME7DJG2/GhDk/kCFXMAqGQgv1vhloqvBnx90z9XW+qsr6iT R076JMRqL7bUPA6nMRsii25peapoVWarVCLL5HNdG/kusB4CrVBJtF4N2pI+CHJMMzjF z/WJ75BWjdRrlBhJx4KHVncA+X977SiVXGxKsmA0vJ+FTB9iSE3d+XoobegRPJqvwMia 5zlw== 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=rlfqSYrNkjFSxwUTlcye06DjNA4hjvTlO8ldGCK0b6M=; fh=6uA3yvXeN55FEhLQ+7xhayEyGzy+Y3z2qOYV5oRrcR8=; b=ZNx/mAHR3l1XaYaAnBJ0wMED2UCIhgoc4qRbrNKjvyM4BG8ztldfnqY2FontptQ3Qe 6Dh2jUNPiHeWgiV5CYR/1BZmp77N/k29hrahY9d2KqYaqJT7a9dfgKXOfuGF0ITJh1XI kivrcgm7V0qKucFPA2onrRQYrpBR6tjgBpHEkeCfS+msUC0b5iXyq/r9ooZw0AU2W61j 7as+3LSOuiSmS3HrOR8c3QgWt3urg/TiRRU0rFiFs/i25OL/lkDk1MUKf/u9GDxkGdA2 M12mDV5VgiN+GLRw8vHl3YlFics4cTtVvlIDHCt/BfMY5cSe9L8tNhh4GBWZ6S5sh1iZ OqeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fPgTO2pY; 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 ga18-20020a05622a591200b00425451018f9si10269398qtb.524.2023.12.11.13.29.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Dec 2023 13:29:38 -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=fPgTO2pY; 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 1rCnjm-0004j5-HF; Mon, 11 Dec 2023 16:22:50 -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 1rCnjk-0004ed-Mv for qemu-devel@nongnu.org; Mon, 11 Dec 2023 16:22:48 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCnjg-0005nf-7t for qemu-devel@nongnu.org; Mon, 11 Dec 2023 16:22:48 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a00f67f120aso651291966b.2 for ; Mon, 11 Dec 2023 13:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702329762; x=1702934562; 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=rlfqSYrNkjFSxwUTlcye06DjNA4hjvTlO8ldGCK0b6M=; b=fPgTO2pY0D/7gfJfs+R9DqIenW2vUWujCvS5BT4R/So6IYLjfG2FVuJk39XuHWW6Jc B0PkKTv72/Vx8CE/lhFLytuvA66453Nu9PTVb0Yjj+Dqww+3KP7ZYQJYaL2r0ZkQMid4 hs8mw9Br4LKYurbFKSWYua72qgxa5vg4qpkFrCh8u8QNQt2jeqvYtHFClEaDEviq+HGc 6f+7xfON06uHE9Oy3vCr3G/RQKRDl+76MRkIZiuNXOFkrXYv5Nq8g+xL3GFO0ELVhnQA XsAfTGM/9VBEA3B5EzTdywqVF++Nb3gw1ZdJZyHt4cRGcU3jmr1MjCwYSNLP+k9yx4Nt WSKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702329762; x=1702934562; 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=rlfqSYrNkjFSxwUTlcye06DjNA4hjvTlO8ldGCK0b6M=; b=psSFqeoN2fHyUEWDcNJ4gaJrghxxATJ6i+u+1U4Zq9KLaIFYqQ0Jn1q9UxmZwoGvPS RKeq/c7p4nV/24/R8CeP0e37gGLliqEC+PUyASZMwu9tHNMJD7v3o9aTQPrCoESkRJ0r NTd/6ARLBCStYkYJ9RuF2noyTjSiXfAwWhffU10pexDl72opUvnHwCa2L/dGtPpwupM5 CdX314GFldIVfJhAReMdeJa6kEybx+1aEprCB//XDKYs2I7GCDyn8bqgXqrU8dcHdStX vCYcqsuMyd9PeJpiSkwURvXrqq4DrLKeSazkp1Hu/Fl/aZaMn/scFa/Oy3CWjJage+hJ 856g== X-Gm-Message-State: AOJu0YyRH6727oG/8qKPMCb7vk7PlfEWT/vVsYHfbLVqC7iT6CjPChaF y+I3plqvrwp8HM1zL2qpwwvax1F8vrA3j3DGwASPvA== X-Received: by 2002:a17:907:503:b0:a19:a19b:55f5 with SMTP id wj3-20020a170907050300b00a19a19b55f5mr2102238ejb.133.1702329762813; Mon, 11 Dec 2023 13:22:42 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.193]) by smtp.gmail.com with ESMTPSA id fj15-20020a1709069c8f00b00a1f6c2c3928sm5093354ejc.175.2023.12.11.13.22.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 Dec 2023 13:22:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-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_Benn=C3=A9e?= , =?utf-8?q?Daniel_P=2E_Berrang=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_Mathieu-Daud=C3=A9?= Subject: [PATCH 19/24] exec/user: Do not include 'cpu.h' in 'abitypes.h' Date: Mon, 11 Dec 2023 22:19:56 +0100 Message-ID: <20231211212003.21686-20-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 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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 First, "exec/user/abitypes.h" is missing the following includes (they are included by "cpu.h"): - "exec/target_long.h" - "exec/cpu-all.h" - "exec/tswap.h" Second, it only requires the definitions from "cpu-param.h", not the huge "cpu.h". In order to avoid "cpu.h", pick the minimum required headers. Assert this user-specific header is only included from user emulation. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/user/abitypes.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h index 6178453d94..1a8cd1ac74 100644 --- a/include/exec/user/abitypes.h +++ b/include/exec/user/abitypes.h @@ -1,7 +1,14 @@ #ifndef EXEC_USER_ABITYPES_H #define EXEC_USER_ABITYPES_H -#include "cpu.h" +#ifndef CONFIG_USER_ONLY +#error Cannot include this header from system emulation +#endif + +#include "cpu-param.h" +#include "exec/target_long.h" +#include "exec/cpu-all.h" +#include "exec/tswap.h" #ifdef TARGET_ABI32 #define TARGET_ABI_BITS 32