From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) (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 DD87927B340 for ; Fri, 24 Jul 2026 03:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784862209; cv=none; b=UPOayiTBy+DR7HZ97Wpe1CjRhFlXZPgoZ+vST7Hq0v0AWmn+ryKuzbvfgvQajbRo9M4RErdJORx9ki65nhg9OyOv8fSDIob35z7tPZ5d/nfh5xlim1Sjr/SbH7lYS3ioNUYbfQKdOACvZoyoIZtbxnFehKVP0BsPXNrBdyZRI/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784862209; c=relaxed/simple; bh=1A+DJI9d4Eycr8b0u2n5pEgVWgG2drQ0GtH6sZUSz60=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pvCpKMBdd06R59kZbmd/owqEYN32Xpj1zFdC3c5ff9ByA/ra2sTcUIW5gRtknv1R4kVMFn3WJ9ag0MX++15kl2nj7sibSjPFPtjZLuUv71vEhayUSdt3hE8zkoPgqmvUDoX9G4xlV7J0nW+t98XW3hAUOJl+LEutf1WnUw4bqtQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MXXrH7O8; arc=none smtp.client-ip=209.85.128.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MXXrH7O8" Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-80e24970f1dso8299567b3.0 for ; Thu, 23 Jul 2026 20:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784862207; x=1785467007; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=hmbR3EKxV5/+aGP6Xq6299coofYvDb69rG8bw4dOT6g=; b=MXXrH7O8idvgCGq6q6nyGiy/j+00coTS8MTT0a6DMyK4VXnNp5ATsANUkSvvDRs1tS yS/vayAYY06mlhKO4ncj8y2iD6qrB/HypVUOVPIKsWdh3WaQ8goWLRxea8KhiTfXZuTr 859jMR+YDk9kAUkjUhLloXS9J/yFvTF4OiiJlRwBr5SyUJGK6xgVWHwH116Xkle8dlP8 1JK5J1hNVj/iUeW9ggiXnLC7SpEyIOiojZYKmQ271nidwVntUChk6iZdZ5Cx3FnUEg3E Ch2fceN75LAQzL8Gpph9mfSOmHEZcA+XhcyKr+otc3pBKK4R0dv6LcJmVYlfETfiaLRP y5hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784862207; x=1785467007; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hmbR3EKxV5/+aGP6Xq6299coofYvDb69rG8bw4dOT6g=; b=ijiYf5RYvwrh3IijoliVyOjt9B1tkERStTcM15wd7xNvkeXz4+KvS8DZ/k3+En4j8F jvnsXFkNGYf32IkhlNVtPu1Gs7a1anfcTM4h2jgcqxtDFqdA4ZoN9oar8LXUJ2EGAAjb fZWomaLzXq6boSkDL6PYs61hE7bFxBuxyaQFw7aYBNvum98yU1IjZTYu4CTlbkuTghLx kVeYSDfrS2vX0NfmiDvAPGacFYsV23zMD5VISLIKRb7EOmS1VHyHrenfS15o+NtT2AGs zdBHQKxM9LJSlWPG6tMsELa4fFsohK3BBuYzsYGJkh28kkTRnecKjQFsFQO3mNBh6NyH B01Q== X-Gm-Message-State: AOJu0Yw7w1djwltn+qtDqH/nCU0XAflMSUyL49Mrj2uJ/Co8krJzq9ih CtXmvwfQpRuqgLGubxUb4cdWvTM5p54a9+Q4lYh31x7x5KQ/sRganAfEtKKk X-Gm-Gg: AR+sD13h3JgTOxjKouGuye7HlIB8y5XDDPrx1Td6kwIXGufAoB1PD1q/Um+ZGp6pDwi G16NS2SaaFw26ffKPBASsVkW0op04lbE2YbjQ8ZP/53XWv4D+QYKWTRZ9NQRUpWZhY0VOtbfN5W f89RVuvSXF5hGdTXT4SNRs2VHfWWY8+zYKTm9qBCf0r7VMZyXn622uK1/RH7/j3/SLsa8y8ZEaA XN49tRZPZk9SCf42ZtNTRLkdXUCsAhd763BlNDyFlpLNfV0jgkNsT8N2x+/mq00siudI6bIqI+d w1y03xXy0ID1JzBfxb8DXCQZ/P9bhd/Vol+P7zRXacJp93JeAAEmDpsp3Iux/B3Xg5wyVRr5jRz MWHWGfq0isIySlaHJVJs2YeWSNKPkzxBae4D4XDlgMaco0vIUcgkx9vJuX4bxyJQouYZ+rA== X-Received: by 2002:a05:690c:4b04:b0:81e:6a10:f90f with SMTP id 00721157ae682-81f4c15eb77mr18512527b3.17.1784862206852; Thu, 23 Jul 2026 20:03:26 -0700 (PDT) Received: from citadel.lan ([2600:6c4a:4df0:2c10::1dba]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81f33c397c9sm37379477b3.14.2026.07.23.20.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 20:03:26 -0700 (PDT) From: Brian Gerst To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Thomas Gleixner , Borislav Petkov , Ard Biesheuvel , Juergen Gross , Tom Lendacky , Brian Gerst Subject: [PATCH 0/5] x86/boot: Early boot cleanups Date: Thu, 23 Jul 2026 23:02:51 -0400 Message-ID: <20260724030256.232690-1-brgerst@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series moves clearing BSS and copying boot parameters and the command line to the early boot code. Clearing BSS early prevents using unitialized data making the code more robust. Copying the boot parameters early simplifies the code by not needing to pass around the orignal source pointer and does not need special handling when encryption is enabled. Note: The memory encryption parts have only been compile tested due to lack of access to capable hardware. Brian Gerst (5): x86/sme: Clear decrypted BSS separately x86/boot/64: Clear BSS as early as possible x86/boot: Remove hardcoded boot_param constants x86/boot/64: Remove copy_bootdata() call x86/boot/64: Copy boot parameters and command line earlier arch/x86/boot/startup/map_kernel.c | 10 ++-- arch/x86/boot/startup/sme.c | 6 ++- arch/x86/include/asm/mem_encrypt.h | 14 ++---- arch/x86/include/asm/setup.h | 11 ++--- arch/x86/kernel/asm-offsets.c | 3 ++ arch/x86/kernel/head64.c | 61 ++--------------------- arch/x86/kernel/head_32.S | 4 +- arch/x86/kernel/head_64.S | 47 ++++++++++++++---- arch/x86/kernel/setup.c | 1 + arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/vmlinux.lds.S | 2 +- arch/x86/mm/mem_encrypt_amd.c | 64 ++----------------------- arch/x86/xen/enlighten_pv.c | 4 +- arch/x86/xen/xen-head.S | 5 +- drivers/firmware/efi/libstub/x86-stub.c | 6 +-- 15 files changed, 76 insertions(+), 164 deletions(-) base-commit: 1b57632fa6f9ad161c2633a6df4c65e973790218 -- 2.55.0