Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp413140rdh; Tue, 19 Dec 2023 02:51:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyLX5aHirQzmtkPyPmY7ea/m1nQYennwDJSuBVWXy7C+pYH2N5FUYR2GM/eoEVwSLFph9m X-Received: by 2002:a17:90b:2415:b0:28b:4a9b:cf5c with SMTP id nr21-20020a17090b241500b0028b4a9bcf5cmr2719842pjb.67.1702983095893; Tue, 19 Dec 2023 02:51:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702983095; cv=none; d=google.com; s=arc-20160816; b=yMGf/WFJ2DxQkxEZYlAC1gpeM+ncP/fYWWFq/vO8jUUQwoNhL6u/cUXMPYy2ECqNUm O1GYI3oQ5zRir15i+Hdz8+FAFoPQDv9ZsPp+pUanxFH2ME+cNpwWjAtybflxCtgaGQeR pj0STdWAkEG3l5MnRkfCnQtzj0rG19n5Vxhc4sthgdBQieG024HvosiwhA6CIbjXJiJG b35jeRML0bvADrsmVx82cM2CJS8bn8ov/6lJ5UTfTBf75xYImhxz5t1QNqEvebWfHAa0 nlBs/AHZQu7c56ZO+wHBjtg88N1w8ifu6YWnxVn5a5f10ZSFB7P+aZdJbKlSJOh7c9g8 z8uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=JXHKJ0n8MkbJlzS9ekFz7nwNPYk1/011jiZ9owfylEw=; fh=olUnnNbCNO6oc7jUK9qAAYJGpIByyDaZzUxHnQ4XdUk=; b=Sehia+YFPWpeYSMwS/iTR154+qeesSvVB1spcDssjwwHMgBAsJZ/Eq5rP2p2JUzWdK MHpvQzjA4WG4XfqOpg9l398nuuLFNua+sj4Tq5cP1N71OCK5AvKrO7qpVVKlMn068fFk XpfYEcKlz/h/fMXOMCcmd5fpgnDSyJ9xm4e2oxPyVxXOn12rqn/Tmuk32dchq8F+AwfG tQE+VaHRCabivgxRgSmEHsIyC5bzwiM7hWoAzFD0bN2iI/kd+Owm9C5b5xJFx+v5Sk37 1D/hNysH7hMTBDzj81DQFeXsh3dCXIERgDiqTmCGckHkvwb/BZxEGvqgtK2Q96gn1MI6 4gBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rSlZHRW4; spf=pass (google.com: domain of linux-kernel+bounces-5034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c12-20020a17090ad90c00b0028bc2e32865si205639pjv.131.2023.12.19.02.51.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 02:51:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rSlZHRW4; spf=pass (google.com: domain of linux-kernel+bounces-5034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 05CAAB24393 for ; Tue, 19 Dec 2023 10:51:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC06414F9F; Tue, 19 Dec 2023 10:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rSlZHRW4" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9B0414AB0; Tue, 19 Dec 2023 10:50:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31AD2C433CC; Tue, 19 Dec 2023 10:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702983050; bh=boVSalnCGlkz1ODJ8LdCVIJrPZvD+WMXnOuvULILNQE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rSlZHRW456R4j32VftJoUKWPnAHhgrIuErQlGx8+Pb2j2R6gm/6sZYXraynlQwSJs TODZF223NDWyXxssJTgkxKy6rklDM0pB2D9VpH/Suk5+j1EAaU+BGRLgN9kA8KVo9U r2oPJL08RVeXSdw5uCE+cwpHHgzhqG8mT7oE56WZwuqIgFi51SFwm2wJvMUzKaiZh1 1VYQErzPuiks0CXWstQxrxt1yz+aISWsGTSWOkgseRb4fUCwJptc78m1r6bDvlSRTW IpYx/fSeDFqCkyZ561JICe2si5ZZLwXTD5H7RVULd+Br553Z19KVlyYriX5GClXcTk LKxuzNuAjwoCA== Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-50bce78f145so5041386e87.0; Tue, 19 Dec 2023 02:50:50 -0800 (PST) X-Gm-Message-State: AOJu0YwEIYk0WsLI7svZXpuDZJSFfpGUfFe6U4cOyCD8TLk86vwdSXkO N7n/2vPPbNz8cyBjMfdXZJAqxLJIIv1PM7v1lBQ= X-Received: by 2002:a19:c21a:0:b0:50e:2b00:1f99 with SMTP id l26-20020a19c21a000000b0050e2b001f99mr864576lfc.100.1702983048284; Tue, 19 Dec 2023 02:50:48 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231215122614.5481-1-tzimmermann@suse.de> <20231215122614.5481-2-tzimmermann@suse.de> In-Reply-To: <20231215122614.5481-2-tzimmermann@suse.de> From: Ard Biesheuvel Date: Tue, 19 Dec 2023 11:50:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/3] arch/x86: Move UAPI setup structures into setup_data.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" Hi Thomas, On Fri, 15 Dec 2023 at 13:26, 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 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 > This is an improvement but not quite what I had in mind: setup_data is a x86 specific linked list that is only referred to via a u64 in setup_header. So setup_data and all the specializations belong in setup_data.h. OTOH, setup_header, the XLF load flags, efi_info, the e820 related definitions etc are not related to setup_data at all but to setup_header. Whether or not setup_header could live in its own header too (along with those related definitions) is a separate question imo, but I don't think they belong in 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