From patchwork Fri Dec 15 12:18:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 179250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9232451dys; Fri, 15 Dec 2023 04:27:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwpWdnaH2z/bCX9XGtLEl4BLEO7c4Xk+mmtFt/iNVVbCdAli/lILsSgxDNwPSG3cypZTpz X-Received: by 2002:a50:9311:0:b0:552:a719:9da with SMTP id m17-20020a509311000000b00552a71909damr590254eda.36.1702643266288; Fri, 15 Dec 2023 04:27:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702643266; cv=none; d=google.com; s=arc-20160816; b=LEmBgNgbTfm9jjR+PvD//WsjwD1Z03bN3I3ocz5sGWE52MFB8vYEQBFGKMRGBfITXJ 1IQ7Kh62T0sob/BlcMOKPWvnbCGdH13CVtaWeAEfYHaiR1N/Cg6Hc8Qe34fjWIStBWjT YnbCz35tsREBO/zqtNoBohTE6/RyoA5VUZCe2pmGbwI5JBcETiUgW1IRrHF6hm3o73FT OBQTTzicusj6aGuUkEkVsGS055GQzgVcILB5A74uFL3hLnJvy4SpNOsSBd8qIv8vmZPU 2ZzSqEj8+pWxym6InxVPNd/gAVZZIOviSwXyKEw4UUS4o9cc7Ud9pyDQp23NtqESxGR7 reug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=yRSvKmc/J7/5tWJgZpc9pXN0+dl1c7KVuJDbYsdVexE=; fh=3EXpYsI7hLQV0a9eUbfkxmF0Cz25dlM5iw5kZeQ5VbU=; b=DrPRDxhrkOnR4UrE5BNXyMUqZJ3DniWPnYfu4GiVunmrNSMy6Y4jwOXxKj+R0KmLfe DuI548iqVN5Xij8X6HnrtD0jZLWuKRK2C8DgwoNeGNrxwJWD9fnKf3OXDZtHnCXWwchJ UYSG6WggohaD7v+NMewsrgaQvf1RKktuvfTJYF5RUDX0oLseOH0UeCOUCzaPMwyPGeus 98YMVYRJ0fjATtu5zIHBJ+iId6Xr+yfjsHg6h/wsfAdgfgHUluly7mP30vZPLZhQXEfG DeyJ5nMgJIiZqySPutj0F0T6YZ4uUdg3jAzvNmPv1NHj+bOwLJZ7LEACVFZaplMz95D+ 19ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=gVP6H5kw; dkim=neutral (no key) header.i=@suse.de header.b=Q6vnj5Gu; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=gVP6H5kw; dkim=neutral (no key) header.i=@suse.de header.b=Q6vnj5Gu; spf=pass (google.com: domain of linux-kernel+bounces-917-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-917-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v1-20020a056402348100b0054ccd70f20esi7697882edc.295.2023.12.15.04.27.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 04:27:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-917-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=gVP6H5kw; dkim=neutral (no key) header.i=@suse.de header.b=Q6vnj5Gu; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=gVP6H5kw; dkim=neutral (no key) header.i=@suse.de header.b=Q6vnj5Gu; spf=pass (google.com: domain of linux-kernel+bounces-917-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-917-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A80BC1F239C6 for ; Fri, 15 Dec 2023 12:27:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E0CA2EB13; Fri, 15 Dec 2023 12:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gVP6H5kw"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Q6vnj5Gu"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gVP6H5kw"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Q6vnj5Gu" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91D6B2C68A; Fri, 15 Dec 2023 12:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 821F922047; Fri, 15 Dec 2023 12:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702643177; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yRSvKmc/J7/5tWJgZpc9pXN0+dl1c7KVuJDbYsdVexE=; b=gVP6H5kwzQ/CjDX9eY//OSsf/qhwQZaov+Yk+O6dW0qHkbWgAjDlDZXPKtGgS8XS5zhXHd CwKxmR8x+ZlAIZHWKmoFNG9JvnO7Hh6Z5U62n2p0W7qTFaJyEhUEc9MrLf9IUEqprbqQAJ qa3aBUbDkHDI+6FvrkBBfjXpA/KACds= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702643177; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yRSvKmc/J7/5tWJgZpc9pXN0+dl1c7KVuJDbYsdVexE=; b=Q6vnj5GunHcI0dCexNHF4UfCcbfOPINokium3ZcDmnfZnvbgjLPZrGlQzPdoa6l8JRkT88 Uabr95EZQT61B7Bg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702643177; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yRSvKmc/J7/5tWJgZpc9pXN0+dl1c7KVuJDbYsdVexE=; b=gVP6H5kwzQ/CjDX9eY//OSsf/qhwQZaov+Yk+O6dW0qHkbWgAjDlDZXPKtGgS8XS5zhXHd CwKxmR8x+ZlAIZHWKmoFNG9JvnO7Hh6Z5U62n2p0W7qTFaJyEhUEc9MrLf9IUEqprbqQAJ qa3aBUbDkHDI+6FvrkBBfjXpA/KACds= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702643177; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yRSvKmc/J7/5tWJgZpc9pXN0+dl1c7KVuJDbYsdVexE=; b=Q6vnj5GunHcI0dCexNHF4UfCcbfOPINokium3ZcDmnfZnvbgjLPZrGlQzPdoa6l8JRkT88 Uabr95EZQT61B7Bg== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id EA62C13BA0; Fri, 15 Dec 2023 12:26:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id OGMOOOhFfGVIRwAAn2gu4w (envelope-from ); Fri, 15 Dec 2023 12:26:16 +0000 From: Thomas Zimmermann To: ardb@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, bhelgaas@google.com, arnd@arndb.de, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, javierm@redhat.com Cc: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 1/3] arch/x86: Move UAPI setup structures into setup_data.h Date: Fri, 15 Dec 2023 13:18:12 +0100 Message-ID: <20231215122614.5481-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231215122614.5481-1-tzimmermann@suse.de> References: <20231215122614.5481-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Flag: NO X-Spam-Score: 3.40 X-Spam-Flag: NO X-Spamd-Result: default: False [3.40 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-3.00)[100.00%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; R_MISSING_CHARSET(2.50)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLthqzz6q5hnubohss7ffybi86)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[22]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linutronix.de,redhat.com,alien8.de,linux.intel.com,zytor.com,google.com,arndb.de,linux.ibm.com,gmail.com,paul-moore.com,namei.org,hallyn.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Level: *** X-Spam-Score: 3.40 Authentication-Results: smtp-out1.suse.de; none X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785350865454380374 X-GMAIL-MSGID: 1785350865454380374 The type definition of struct pci_setup_rom in requires struct setup_data from . Many drivers include , but do not use boot parameters. Changes to bootparam.h or its included header files could easily trigger a large, unnecessary rebuild of the kernel. Moving struct setup_data and related code into its own own header file avoids including in . Instead include the new header and remove the include statement for x86_init.h, which is unnecessary but pulls in bootparams.h. Suggested-by: Ard Biesheuvel Signed-off-by: Thomas Zimmermann --- arch/x86/include/asm/pci.h | 2 +- arch/x86/include/uapi/asm/bootparam.h | 218 +---------------------- arch/x86/include/uapi/asm/setup_data.h | 229 +++++++++++++++++++++++++ 3 files changed, 231 insertions(+), 218 deletions(-) create mode 100644 arch/x86/include/uapi/asm/setup_data.h diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index b40c462b4af3..f6100df3652e 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include struct pci_sysdata { int domain; /* PCI domain */ diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h index 01d19fc22346..f6361eb792fd 100644 --- a/arch/x86/include/uapi/asm/bootparam.h +++ b/arch/x86/include/uapi/asm/bootparam.h @@ -2,42 +2,7 @@ #ifndef _ASM_X86_BOOTPARAM_H #define _ASM_X86_BOOTPARAM_H -/* setup_data/setup_indirect types */ -#define SETUP_NONE 0 -#define SETUP_E820_EXT 1 -#define SETUP_DTB 2 -#define SETUP_PCI 3 -#define SETUP_EFI 4 -#define SETUP_APPLE_PROPERTIES 5 -#define SETUP_JAILHOUSE 6 -#define SETUP_CC_BLOB 7 -#define SETUP_IMA 8 -#define SETUP_RNG_SEED 9 -#define SETUP_ENUM_MAX SETUP_RNG_SEED - -#define SETUP_INDIRECT (1<<31) -#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT) - -/* ram_size flags */ -#define RAMDISK_IMAGE_START_MASK 0x07FF -#define RAMDISK_PROMPT_FLAG 0x8000 -#define RAMDISK_LOAD_FLAG 0x4000 - -/* loadflags */ -#define LOADED_HIGH (1<<0) -#define KASLR_FLAG (1<<1) -#define QUIET_FLAG (1<<5) -#define KEEP_SEGMENTS (1<<6) -#define CAN_USE_HEAP (1<<7) - -/* xloadflags */ -#define XLF_KERNEL_64 (1<<0) -#define XLF_CAN_BE_LOADED_ABOVE_4G (1<<1) -#define XLF_EFI_HANDOVER_32 (1<<2) -#define XLF_EFI_HANDOVER_64 (1<<3) -#define XLF_EFI_KEXEC (1<<4) -#define XLF_5LEVEL (1<<5) -#define XLF_5LEVEL_ENABLED (1<<6) +#include #ifndef __ASSEMBLY__ @@ -48,139 +13,6 @@ #include #include