Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1528201rdb; Mon, 8 Jan 2024 01:59:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkxQ3xBWqFngGL2rrvLWW5BR6h+bflPUkfXobpMSpOEt42j1xR77qiM0mcXAYmnkZKuERh X-Received: by 2002:a17:907:948f:b0:a23:4998:7e6e with SMTP id dm15-20020a170907948f00b00a2349987e6emr6984951ejc.5.1704707987530; Mon, 08 Jan 2024 01:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704707987; cv=none; d=google.com; s=arc-20160816; b=uDnBcGwyfp3EWpzRTcNCvx+a7M0B/FeqcluGLSBNfss5OxR0r+/B+KXaiam3K3mGPQ 605x+5/+R6tdmGoNoyjiZyVp4PeXTUQbEOudORDczo2fhnnEqlC6cGtIcQGxqjSb8de8 k5kRAky9x1DzRo5XUwxaXy33a0rNksa2KL8ViQWCHVisYupOXIn48Uyg7BF5ywC07ObF naBsDQ8r80T1uemFR6/Rm/YhFyWhoj8VyJ0AdjO+ThYdHyntsL44km1RFrDzV1KwJkhP Rc7vcmbow6yQN4Gye2o+cwGwFv2aGFbhyMvd5HI3qTaKpAUevZrZhaWJpuuOJ92mnFCw DxmA== 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; bh=mwqlQN7osRy52YJQrNRPyoQ8UG7hSJMOqmjhS8Aapgo=; fh=3EXpYsI7hLQV0a9eUbfkxmF0Cz25dlM5iw5kZeQ5VbU=; b=0Nb3sGUr3E+FaH1DbbDUGtn4xkWKJ9eaY2cC4MYKRQyk6sYrYH7iQIcdD5ceS5tUuT b9ymi3i+4tkSVtnRvejibJrlbO1duyE6s34FwkKNRHVKZIfP115yR0jEty2UKI+gn9NZ 4Zcv5yVuNpYPBd0gut9sJEGoaPHcicmRgk34rFrFpdhZ35CM5qjaWYWBKtnuXlx4u0b0 d/2VjX1Q2D5hUQRDNEgkD821QNVnR4eN6NAO4XIWKHxCMMMkEC4A+mFXWpT++9hpyleW UhDAKdyAmsIupF29WwXkZL4Mp0qNGfbG0+GIFfjTfS0dPkvD31cKdgnrPl0ff6aPK4Ai N4aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19307-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19307-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q6-20020a50c346000000b00557a96d51afsi849690edb.540.2024.01.08.01.59.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 01:59:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19307-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19307-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19307-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (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 223A41F22181 for ; Mon, 8 Jan 2024 09:59:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 267B014266; Mon, 8 Jan 2024 09:59:11 +0000 (UTC) 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 E953012B87; Mon, 8 Jan 2024 09:59:08 +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 imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 2D28E21DA5; Mon, 8 Jan 2024 09:59:07 +0000 (UTC) Received: from imap1.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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A94621392C; Mon, 8 Jan 2024 09:59:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GNY5KGrHm2XFMwAAD6G6ig (envelope-from ); Mon, 08 Jan 2024 09:59:06 +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 v4 2/4] arch/x86: Move internal setup_data structures into setup_data.h Date: Mon, 8 Jan 2024 10:57:28 +0100 Message-ID: <20240108095903.8427-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240108095903.8427-1-tzimmermann@suse.de> References: <20240108095903.8427-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 2D28E21DA5 Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: -4.00 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-4.00 / 50.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] 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 pci_setup_rom into its own header file avoids including in . Moving struct_efi_setup_data allows to unify duplicated definition of the data structure in a single place. Signed-off-by: Thomas Zimmermann --- arch/x86/boot/compressed/efi.h | 9 --------- arch/x86/include/asm/efi.h | 9 --------- arch/x86/include/asm/pci.h | 13 ------------- arch/x86/include/asm/setup_data.h | 32 +++++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 arch/x86/include/asm/setup_data.h diff --git a/arch/x86/boot/compressed/efi.h b/arch/x86/boot/compressed/efi.h index 866c0af8b5b9..b22300970f97 100644 --- a/arch/x86/boot/compressed/efi.h +++ b/arch/x86/boot/compressed/efi.h @@ -97,15 +97,6 @@ typedef struct { u32 tables; } efi_system_table_32_t; -/* kexec external ABI */ -struct efi_setup_data { - u64 fw_vendor; - u64 __unused; - u64 tables; - u64 smbios; - u64 reserved[8]; -}; - struct efi_unaccepted_memory { u32 version; u32 unit_size; diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index c4555b269a1b..a5d7a83e4c2a 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -143,15 +143,6 @@ extern void efi_free_boot_services(void); void arch_efi_call_virt_setup(void); void arch_efi_call_virt_teardown(void); -/* kexec external ABI */ -struct efi_setup_data { - u64 fw_vendor; - u64 __unused; - u64 tables; - u64 smbios; - u64 reserved[8]; -}; - extern u64 efi_setup; #ifdef CONFIG_EFI diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index f6100df3652e..b3ab80a03365 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -10,7 +10,6 @@ #include #include #include -#include struct pci_sysdata { int domain; /* PCI domain */ @@ -124,16 +123,4 @@ cpumask_of_pcibus(const struct pci_bus *bus) } #endif -struct pci_setup_rom { - struct setup_data data; - uint16_t vendor; - uint16_t devid; - uint64_t pcilen; - unsigned long segment; - unsigned long bus; - unsigned long device; - unsigned long function; - uint8_t romdata[]; -}; - #endif /* _ASM_X86_PCI_H */ diff --git a/arch/x86/include/asm/setup_data.h b/arch/x86/include/asm/setup_data.h new file mode 100644 index 000000000000..77c51111a893 --- /dev/null +++ b/arch/x86/include/asm/setup_data.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_X86_SETUP_DATA_H +#define _ASM_X86_SETUP_DATA_H + +#include + +#ifndef __ASSEMBLY__ + +struct pci_setup_rom { + struct setup_data data; + uint16_t vendor; + uint16_t devid; + uint64_t pcilen; + unsigned long segment; + unsigned long bus; + unsigned long device; + unsigned long function; + uint8_t romdata[]; +}; + +/* kexec external ABI */ +struct efi_setup_data { + u64 fw_vendor; + u64 __unused; + u64 tables; + u64 smbios; + u64 reserved[8]; +}; + +#endif /* __ASSEMBLY__ */ + +#endif /* _ASM_X86_SETUP_DATA_H */ -- 2.43.0