From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 DEDB630FC33; Wed, 27 May 2026 16:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779900143; cv=none; b=jMv/k3ZPkSXCu9/ri/lcHCF1WIFDA4f3hEFonOMsE4gPkwSB35aMsN7cwcDxAwTLPjChuXDDBcoqOQepfa4PRkd1xm1Ax33hgNg3twC1hMkoZWk9AVnhvbdT1r2Q4nx5fgTBv6TCZkZwub8yjgoKpphojdIkQiFqklMGUXJ8uL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779900143; c=relaxed/simple; bh=zkxhXyottikXIASB/hUTc93O26xnKdgKpEbXjh2K15Q=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=QGE4E06Ra1WgC35PQeT1X5zAMz2ZLFrweENPtKLaGvTFwF9xoDPmym5NOt6QztwOHDmwHF7wMtw2cvb12HfQkBFMjztdynTWO0c1rnAHfnQMNyQPUpzP7MroHphxx+j22mKezB4TVk0dsluuFfA5oTcQ3HWqOix1G43711bOHaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=M+uY+Lnt; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="M+uY+Lnt" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:From:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=r9X3i/MQsjWdphpDbkCPYHpgfOslyLkMzTbWCKDOiYM=; b=M+uY+LntFAqwzvPML/mrzPidGW bNK0BEzeHac54ePgYbD8KIZUrq7gNJP4JXZXV7yhd7JrS8syBes1haL0/mR9hczHRuIho7YqNvSTf MGopu+X1PvMzkdpyEVnue/Qiees6lICO0kgXhV+FaqbNaR3BtraTT4M5lB7UtxhVB0F8glrt/I/ZK +w07xSOM3CuS+6FI+1xKNf1a2RbQmMJZcvwdgaonP1kym9pgwLmYYTXUIKUZ8GjRTjnEWHhP+9fQJ U29PR403P8CIZtUiwkFUAr0R+93wcGHE/ZyotpMF6mE7Jhs8ppR3y2na5kMOKktcTRuPrk1LMtgHi iqSDs8+w==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wSHKM-003JPU-1F; Wed, 27 May 2026 16:41:54 +0000 From: Breno Leitao Subject: [PATCH 0/4] bootconfig: embed kernel.* cmdline at build time Date: Wed, 27 May 2026 09:41:33 -0700 Message-Id: <20260527-bootconfig_using_tools-v1-0-b6906a86e7d5@debian.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAL0eF2oC/yXMUQrCMAwA0KuEfK9QB5vaq4iMrEtrRBppOhHG7 i7q5/t5GxpXYcMAG1Z+iYkWDHDoAOONSmYnCwbA3vejH/zJzaotakmSp9Wk5KmpPszFREei8zL SQNgBPisnef/iy/VvW+c7x/bdcN8/cFUgYHoAAAA= X-Change-ID: 20260508-bootconfig_using_tools-cfa7aa9d6a5a To: Masami Hiramatsu , Andrew Morton , Nathan Chancellor , paulmck@kernel.org, Nicolas Schier Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-d5d98 X-Developer-Signature: v=1; a=openpgp-sha256; l=1917; i=leitao@debian.org; h=from:subject:message-id; bh=zkxhXyottikXIASB/hUTc93O26xnKdgKpEbXjh2K15Q=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqFx7NjbsgZiqKcKT4KdzKhZSDbQEQ56G6UGRly 4vo4tuPGgqJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCahcezQAKCRA1o5Of/Hh3 bWgqEACO/ivyxBbyf61F1jL9lKEiHowLiDZQo1iwq5bK3VrJihYSQwRxGWWuaDQd48JDASObAa7 z5Daf7EugjNwER3rGQlR9WSO/9dkJ8JTz0iy3cAGvRYRqFgGJUdBJ1ToP4vwOCKZMwip/prYcUW 5q+HPfspFQ1EOGquhfo0oSmJ7+Z2zycORf5Y2mVng18UG7IMTH9/LTyrMYBXHF0DnQM2c9il4XM sUMugaF0ZA9DSw6rRXOxlo3sE07Ca1PLfBtwGgoJvTxf47CDZUrYzbtz/oPiiCz5HBz5HVUi51k ZHwM0uZYAWSvVfcdNXGNTu/DWKVTeDGTfeHZqsDHwxR/I6/ToD7mgJ+6+33f1GZEs+z2kgt4CBK 7PNiZJOJpz5yC7fmvOmVwfAdfi8PKhHGHoB3nVPqO6TSinRKj8coC10Nzpu6aKunrZTZVawZ3E/ 6WtCfXj0wRkD/gClHlfisDXvjN87x/dWdHDmbX976mOWpE6xmuz6LP0mqftwNg3dBRJzpkZ1/Re DVJNVEcqBudH0OHDUHWk9jhwqgwghfTiiGS1grN4KPwznj8tvJfpxBEpNHeD36vNR1tIQlxlbxz T5BGoXw99Wbx1pCgh9c0nxhHM49qPl0BDeUbthJFPMlijN9+ibqGGeFG4zlN1luzdRaGqHeIYPg vpw6/vAkbM2IeJA== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao The userspace pieces (xbc_snprint_cmdline() in lib/, tools/bootconfig -C) already landed; this series wires the rendered cmdline into the kernel. Motivation: today the embedded bootconfig is parsed at runtime, after parse_early_param() has already run, so early_param() handlers can't see embedded values. Folding the kernel.* subtree into the cmdline at build time gives a CONFIG_CMDLINE-equivalent for embedded-bootconfig users without forcing them to maintain two cmdline sources. Behaviorally, the "kernel" subtree is rendered to a flat string at build time and stashed in .init.rodata. setup_arch() prepends it to boot_command_line before parse_early_param() runs. Overflow is a soft error: the helper logs and leaves boot_command_line untouched rather than panicking, so an oversized embedded bconf cannot brick a boot. Signed-off-by: Breno Leitao --- Breno Leitao (4): bootconfig: return 0 from xbc_snprint_cmdline() for a leaf root bootconfig: render embedded bootconfig as a kernel cmdline at build time bootconfig: add xbc_prepend_embedded_cmdline() helper x86/setup: prepend embedded bootconfig cmdline before parse_early_param Makefile | 5 ++++ arch/x86/Kconfig | 1 + arch/x86/kernel/setup.c | 3 +++ include/linux/bootconfig.h | 7 ++++++ init/Kconfig | 33 ++++++++++++++++++++++++++ init/main.c | 19 ++++++++++++--- lib/Makefile | 16 +++++++++++++ lib/bootconfig.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++ lib/embedded-cmdline.S | 16 +++++++++++++ tools/bootconfig/Makefile | 2 +- 10 files changed, 156 insertions(+), 4 deletions(-) --- base-commit: e7e28506af98ce4e1059e5ec59334b335c00a246 change-id: 20260508-bootconfig_using_tools-cfa7aa9d6a5a Best regards, -- Breno Leitao