Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1740005rdb; Thu, 7 Dec 2023 07:36:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmvVq+/VkcpCVC2niBvdvWuuSG21KWGdo1AdtP7UP63Idlffk23YgUE0aCtaQ3M0ZlLA85 X-Received: by 2002:a05:6a00:1d8d:b0:6be:4228:698b with SMTP id z13-20020a056a001d8d00b006be4228698bmr2372217pfw.20.1701963393632; Thu, 07 Dec 2023 07:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701963393; cv=none; d=google.com; s=arc-20160816; b=eDUr11YnOBgcUOdY7tbO3HMDo5bI/UKjSXH4xnk++QGkgnMw4sZ9Wc9CeAZayH2d6i j8ThwJzq3m04TO+HcXfp069JjmCPgwPhNwaypQ7KaqEge1iMDclLSmEp1Ipcigxr6RHa o5O99VWXB2LpJRzewr6WDWuv8pk0s8XKbYB1FZXU0HxNFm4yLhuuBFA8JjMFcsFgO6ar iGKZXAbpVRfgyfXxBdl8TzVrc3sUyhBUgJUFdeDEgC3/NWFWshW3QJs8evsYv4KJjrz5 9Ha01atXNRLVyOGYimztSZnL2ww6wfkpZVhlbSUsnne/tuH8cj5KXx5rZLB67Cpyuhkg 1JWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5lxOEztTHNyabHtJ9nH29PYQo9Xt5cCEldawtZAxYVE=; fh=olUnnNbCNO6oc7jUK9qAAYJGpIByyDaZzUxHnQ4XdUk=; b=wnU5SeyDMGMABNwY0DO/qRSEDngrXA9JKZBA91jjPibZn+JErQgqUArtXzHsurFwtr SJ8yRQIIVooo5xjqVnzqNTrxiU+M8k3LsBW7yQyhJbT/Lah2hmLQG0ccUyE2kff8Q787 h5ShKDgpDxjeke5v8VnYDuxpRElAWEpNrxIjmIuImFcWgz0yuzXGDnEqcvjO8tUI00Rk 3XHoJEgZGMsY+JO9NCF3Me6CKi/6haFsVx6eYGBqCcsxJ/HEDq/tMlf0L35ldu6NSSkF J/g38Y38yuxqZlFkeWcVcwL7yHUK4JXqITZz7zyCnn2SEChxVaj/ENshf63KUCCeTZ43 8xyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mz/wOiEC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 20-20020a630c54000000b005bd04873387si1339048pgm.105.2023.12.07.07.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:36:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mz/wOiEC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DE9EF8076652; Thu, 7 Dec 2023 07:35:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443511AbjLGPfO (ORCPT + 99 others); Thu, 7 Dec 2023 10:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443546AbjLGPfK (ORCPT ); Thu, 7 Dec 2023 10:35:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20B6910F8 for ; Thu, 7 Dec 2023 07:35:17 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8582DC433AD; Thu, 7 Dec 2023 15:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701963316; bh=GX1JJEdl3nBIPUgvKvrvyG3QPg50ra5uqsG8fD9kqBk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mz/wOiECHCVR1Lz74BNfGrVpl75pi4T1SmdNhY7T5tllzwvHekJAKY+DnlhOdAJ3H Y5ET2/EfKwazOw1UTaJeeVu74l04i5jYhNIEy1L2Z2z6ZHuM0TDun+Tdj+cig5PmlS yDK+FLExVUpT0R5XuaZ9WbDFDV/WKCUuMsBVjWNUSxth1pqW62e88T58K444wwlrZn Z6sEM2E99OWA1wwwE7tbnvv935G2s6uoEpKMjI7mHkiHNAdAE1YTcgQZ1GS3U88oiP gTd7Zjm9pdWTskE52YIYsPXPKUoaVgu+iSzbE6ZSSy0H8O7+/l6TKFn0yOnU+gv8Xe da57Lx0/Ymf8g== Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2c9eca5bbaeso11055361fa.3; Thu, 07 Dec 2023 07:35:16 -0800 (PST) X-Gm-Message-State: AOJu0Ywc97LuL7Z11n9vC6iKMixZRw+byohIi3XdAxR0zef+lA4tk76P PfFfTyDPDarXw14Lfi9RdNBr1V8rGuOiphPCrew= X-Received: by 2002:a2e:7c15:0:b0:2c9:f2a5:7145 with SMTP id x21-20020a2e7c15000000b002c9f2a57145mr888908ljc.142.1701963314593; Thu, 07 Dec 2023 07:35:14 -0800 (PST) MIME-Version: 1.0 References: <20231206125433.18420-1-tzimmermann@suse.de> <20231206125433.18420-2-tzimmermann@suse.de> In-Reply-To: <20231206125433.18420-2-tzimmermann@suse.de> From: Ard Biesheuvel Date: Thu, 7 Dec 2023 16:35:03 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/3] arch/x86: Move struct pci_setup_rom into pci_setup.h To: Thomas Zimmermann Cc: 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, 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:35:38 -0800 (PST) Hello Thomas, On Wed, 6 Dec 2023 at 13:54, Thomas Zimmermann wrote: > > 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 avoid including > in . Update the only two users of the > struct in the x86 PCI code and in the EFI code. Also remove the include > statement for x86_init.h, which is unnecessary but pulls in bootparams.h. > > Signed-off-by: Thomas Zimmermann > --- > arch/x86/include/asm/pci.h | 13 ------------- > arch/x86/include/asm/pci_setup.h | 19 +++++++++++++++++++ > arch/x86/pci/common.c | 1 + > drivers/firmware/efi/libstub/x86-stub.c | 1 + > 4 files changed, 21 insertions(+), 13 deletions(-) > create mode 100644 arch/x86/include/asm/pci_setup.h > Thanks for cleaning this up. Would it be more appropriate to move all setup_data related definitions into a separate header entirely? - the SETUP_ defines - struct setup_data - struct pci_setup_rom - struct jailhouse_setup_data etc etc struct setup_header has a setup_data field which is the root of the setup_data linked list, but it is typed as __u64 so it doesn't actually need to know the real type of the associated structs. That way, you can avoid creating a special asm/pci_setup.h that only covers this one particular definition. > diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h > index b40c462b4af3..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/pci_setup.h b/arch/x86/include/asm/pci_setup.h > new file mode 100644 > index 000000000000..b4b246ef6f2b > --- /dev/null > +++ b/arch/x86/include/asm/pci_setup.h > @@ -0,0 +1,19 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _ASM_X86_PCI_SETUP_H > +#define _ASM_X86_PCI_SETUP_H > + > +#include > + > +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_SETUP_H */ > diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c > index ddb798603201..c6cbb9182160 100644 > --- a/arch/x86/pci/common.c > +++ b/arch/x86/pci/common.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c > index 1bfdae34df39..0c878ebe5257 100644 > --- a/drivers/firmware/efi/libstub/x86-stub.c > +++ b/drivers/firmware/efi/libstub/x86-stub.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > > #include "efistub.h" > #include "x86-stub.h" > -- > 2.43.0 >