From patchwork Tue Apr 22 19:26:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 883122 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp2597056wrs; Tue, 22 Apr 2025 13:01:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUBFNo9CzhdcsQrvR9ETadwauBfuP5b2MLKUPQ/ybHvMQvYTyI7a3jnE2z8RXTyZZdsRg5TuQ==@linaro.org X-Google-Smtp-Source: AGHT+IG3tEjWZF6V31NShmjhrr6BEHdEF4yhzuTcWcNRQWQzP4nZu8zlUfcB5s3LCFcDuB1jZCQH X-Received: by 2002:a05:6102:5617:b0:4c5:505a:c1f5 with SMTP id ada2fe7eead31-4cb8023e9e3mr10839324137.24.1745352095197; Tue, 22 Apr 2025 13:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745352095; cv=none; d=google.com; s=arc-20240605; b=F62poYrG2dwOZUovHm4AY/GTyYZ+uqks2ZHXLvNcMICFDRtXlJ3/buhqoDHLM51Hdr V+Sp3qDamKZTK4RL/87yJCXGU8UWsu9HIWKrTVdQ8/wiRNtiX1ZynZABVuI7d90Ux3zn nWL+ug9nxc/+RMTHbYKPIBAh9Z/K1arzFlydNvtnFN/lxBSFhG8ZqfP1y5gwBnTlRHXO +wX3Y6iYWG20j5vcWoOOGsOF7eqvl/8XOu6BIMURum1x1JWnrCZq0tEPG2uMGQtn252j ldQE+djLnWAVy55wDlYvqu5yCWx4mp6L+1OFSXTaLTWoTm8Dnu34ZijQVtXSeqT9nb89 DOAA== 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=LeENUlDVgehwxdXE0XXPfIIxCZLEhLec/NmTrOg0uCg=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Z8fogfIB4ibbElZhsuwMIQv/nnxADrFDTRZoElLNN+eZddL7eqqT2zp3vH+pU2R9x7 p55Tw0HSruN+zKWKd75A51mrWjQE9JFqXXfb+n7a6/Fk4eW33AM5NR7FtxnUOMCpmc73 9VnDOiAUZV4YRlsvQvwDujhLsVbYxo3hoTNRNtvuZ7ryHQjAwcPHuZc3QKwmX9u5+Baf dIYT4yWQ2iNetaWpgr9wVauikuwnconDT5rLm+s/nNqJdBeR209c8XdzMjD7JQ+V42NW iylbjMIiJnwkPeyNYHExV5bTdQJT41O/ACcVS7fWD+R8MnhhPBXey5oojcFbdOKA9Aah vNsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ptIttOG8; 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 ada2fe7eead31-4cb7e007c1csi2560049137.499.2025.04.22.13.01.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Apr 2025 13:01:35 -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=ptIttOG8; 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 1u7JQg-0000Zy-Nx; Tue, 22 Apr 2025 15:37:15 -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 1u7JLh-0000fr-DR for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:32:07 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7JLe-0006dm-AM for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:32:04 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2243803b776so87046045ad.0 for ; Tue, 22 Apr 2025 12:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745350321; x=1745955121; 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=LeENUlDVgehwxdXE0XXPfIIxCZLEhLec/NmTrOg0uCg=; b=ptIttOG8nxSjjNMj5KSgBMA39cXJt20rqBXlGJ2b9IP0X+IAlTtOtBupeJrNsZUOHk nvaz2jS6XRKUrswjyFbf4uJVTJJvH5GKzy8JutZR4PvuF7JqmSgzaHkozUZTxmHN9U87 Hv3bUrz/mu2Lzm4w0nmQUqKizPUBBxnbdxI/ogfAIqNR+0WoFcRdQluoNJKud3IGWUee 0orAkrGdkhnSjMV0wyRWqkurwYRPPIHwF0d2tfWits/DNY7pUzoqncecE+y0VsvujPPB qj8RKQs3KdtAbdbYFZtif5WhAzOf1VTaRfee1q7GJcnFqD8Zch+nejjr8SWSqStP6fCL iaYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745350321; x=1745955121; 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=LeENUlDVgehwxdXE0XXPfIIxCZLEhLec/NmTrOg0uCg=; b=xHbRC3D2mLiGBhz8jg9XENdxaA1e9+3l1aBs27dAx5czkaXuQAtisSY7IqsLLHHnKB gpvjnRg0hQFB1Bu+/0xXlCGynD7NBk0Uh/lhbEMLLojfUDavdWmlLlIbyrgQcBgKlIcX YhdOu+2fUe7ZhjDx3w8LUjdrCuGwtf0TEbM+MZEsVeGRwLiZlqrjDFNsmu6peThf/Cdt G6ESiiH02g/UKTKDIM/lB4GdghmuVsLaEvtBQnK9J5QQ9SKQEbnFQLYwS/l2BMXcoFok msOBLEtjB95Qj3PJC14vwh2QNxrcx/27XepIpxwYlUt96vUP2bu5JGBtVDaF4hBSJEcp oG8A== X-Gm-Message-State: AOJu0YzVxwuVTzHwi1pQVBuMSHAcQkQrLxf1ICjaRqrcwRODbDnmbNYB TQOnqm5oCXBjjcm/+equlQ53GkJcFFjK7jqTS2F2dNQ3qUls+PCPL2kWV6o0Zh2TuSocwjMdGUE j X-Gm-Gg: ASbGncval+1/rBY7IMMkKnrUI70esIIXuAtp6kiiQfBEj2sH9JX94OGpZFGk04mAMaF 43oaQcq1PPsTrbqK3+PpoDOq3giaby3H49HhV3pctTkv/XYEjzZ6NL8d3Q7JOoRPf6vyebfxx1m h6QM7eZNifDK0OG12+NxcoMKnOJgVU0o2UpY5NVlal1gkq4Og3Xvgdd9iOrhGpLmtwtjYA1mwTr iRiaIaUIEtcHvYrfuHDIkFSOrket+jGdm55++GKkvOfEFc2j2YYr9J9WfjJJ0LVT7jRDX8lmVlJ b+6OqtjmMxIRcIX5S81UBFXenVQU0Ar7EkUkxG/dNFZTlNpweqd2gHWsyPePlVO8jFKVhA+/9J0 = X-Received: by 2002:a17:902:db01:b0:223:501c:7581 with SMTP id d9443c01a7336-22c535a4e39mr236437975ad.16.1745350320812; Tue, 22 Apr 2025 12:32:00 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22c50bdda3bsm89312635ad.27.2025.04.22.12.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 12:32:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH 061/147] meson: Only allow CONFIG_USER_ONLY from certain source sets Date: Tue, 22 Apr 2025 12:26:50 -0700 Message-ID: <20250422192819.302784-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250422192819.302784-1-richard.henderson@linaro.org> References: <20250422192819.302784-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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 Poison CONFIG_USER_ONLY and CONFIG_SOFTMMU unless the compilation unit is in specific_ss, libuser_ss, or libsystem_ss. This is intended to prevent files being incorrectly added to common_ss. Remove #ifndef CONFIG_USER_ONLY / #error / #endif blocks. All they do is trigger the poison error. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/exec/poison.h | 5 +++++ include/hw/hw.h | 4 ---- include/system/confidential-guest-support.h | 4 ---- include/system/replay.h | 4 ---- include/system/xen.h | 4 ---- meson.build | 6 ++++-- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/include/exec/poison.h b/include/exec/poison.h index 2c151fd1e0..4180a5a489 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -66,4 +66,9 @@ #pragma GCC poison CONFIG_WHPX #pragma GCC poison CONFIG_XEN +#ifndef COMPILING_SYSTEM_VS_USER +#pragma GCC poison CONFIG_USER_ONLY +#pragma GCC poison CONFIG_SOFTMMU +#endif + #endif diff --git a/include/hw/hw.h b/include/hw/hw.h index 045c1c8b09..1b33d12b7f 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -1,10 +1,6 @@ #ifndef QEMU_HW_H #define QEMU_HW_H -#ifdef CONFIG_USER_ONLY -#error Cannot include hw/hw.h from user emulation -#endif - G_NORETURN void hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2); #endif diff --git a/include/system/confidential-guest-support.h b/include/system/confidential-guest-support.h index b68c4bebbc..ea46b50c56 100644 --- a/include/system/confidential-guest-support.h +++ b/include/system/confidential-guest-support.h @@ -18,10 +18,6 @@ #ifndef QEMU_CONFIDENTIAL_GUEST_SUPPORT_H #define QEMU_CONFIDENTIAL_GUEST_SUPPORT_H -#ifdef CONFIG_USER_ONLY -#error Cannot include system/confidential-guest-support.h from user emulation -#endif - #include "qom/object.h" #define TYPE_CONFIDENTIAL_GUEST_SUPPORT "confidential-guest-support" diff --git a/include/system/replay.h b/include/system/replay.h index 8926d8cf4b..1c87c97fdd 100644 --- a/include/system/replay.h +++ b/include/system/replay.h @@ -11,10 +11,6 @@ #ifndef SYSTEM_REPLAY_H #define SYSTEM_REPLAY_H -#ifdef CONFIG_USER_ONLY -#error Cannot include this header from user emulation -#endif - #include "exec/replay-core.h" #include "qapi/qapi-types-misc.h" #include "qapi/qapi-types-run-state.h" diff --git a/include/system/xen.h b/include/system/xen.h index 5f41915732..c2f283d1c2 100644 --- a/include/system/xen.h +++ b/include/system/xen.h @@ -10,10 +10,6 @@ #ifndef SYSTEM_XEN_H #define SYSTEM_XEN_H -#ifdef CONFIG_USER_ONLY -#error Cannot include system/xen.h from user emulation -#endif - #include "exec/cpu-common.h" #ifdef COMPILING_PER_TARGET diff --git a/meson.build b/meson.build index 7e22afe135..657949326b 100644 --- a/meson.build +++ b/meson.build @@ -4050,7 +4050,8 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss) libuser_ss = libuser_ss.apply({}) libuser = static_library('user', libuser_ss.sources() + genh, - c_args: '-DCONFIG_USER_ONLY', + c_args: ['-DCONFIG_USER_ONLY', + '-DCOMPILING_SYSTEM_VS_USER'], dependencies: libuser_ss.dependencies(), build_by_default: false) libuser = declare_dependency(objects: libuser.extract_all_objects(recursive: false), @@ -4060,7 +4061,8 @@ common_ss.add(when: 'CONFIG_USER_ONLY', if_true: libuser) libsystem_ss = libsystem_ss.apply({}) libsystem = static_library('system', libsystem_ss.sources() + genh, - c_args: '-DCONFIG_SOFTMMU', + c_args: ['-DCONFIG_SOFTMMU', + '-DCOMPILING_SYSTEM_VS_USER'], dependencies: libsystem_ss.dependencies(), build_by_default: false) libsystem = declare_dependency(objects: libsystem.extract_all_objects(recursive: false),