From nobody Mon Feb 9 01:44:50 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 7FEA225742C for ; Mon, 10 Feb 2025 17:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739209818; cv=none; b=nTSnJVPwG53Zg+p1StdbXT+mS6jv21SWLxJMGXtg2t8RBMMKgrqYJ+dl09+SwgL/1dsA5+cRcYoJLhDTXTIsuSkEqXABnIH7ojV8sxGLuwo3P+inL5G/siy3bzSm0c2nZtriTbadWb1SGVbZTCA21l/9BefjTycwTWS+An6iKCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739209818; c=relaxed/simple; bh=b5Y7ZBwua8q6S8xoX8bJWja8rSBdbaXg1go2fucz19o=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=KJn8FMCHN5Xd5/ij3aHifXVgu8bIrAGUa6cIKuptf7KodvurwnVESS3AYeE7+r4+TvBH+17PqDMMcodqw+0iDoPK+hVPZCCNxxTzcBKj1dYOGzDUhAXlOCB8SBreke89CfTxgWyU1YCwQmCoWQrnZ/Ft4n2O2wv9B3TdTdtRgPA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=JZoLnnnu; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="JZoLnnnu" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4392fc6bceaso12663955e9.2 for ; Mon, 10 Feb 2025 09:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1739209815; x=1739814615; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=2tIHDOPF0PNls1nT25rio5qx/bjBew1n2yApk83FuUI=; b=JZoLnnnuc1RB97KG6XplP2Rn0PPRj2d1gHHMA337tl2VduP9TZbVUUMqIdxNxCvnJX Elg9ABrpMGDZD4A5vV5h7jrAYQsnkhJCzC/matektP1++y9lzA+85icjRoGzS0y1XnBk zUt/96acAa7dW4j+o7G2DnguflAxELymuc6+n0bcnzwwFIOu3HthfgmAJn6j7p5a/1rj J/M8CrBe3MrKRMhdV05w6GMT/Nc5uuTCyD31+zu5atB/xSjuz24CwvyJ02yx6kZI4NNO 12OjpgAcLSam2T3cxgT9BZU1WhU1ARg8nmERIbSOuTNDLs//pwKn65ot/2HSlAUFhGy9 eW7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739209815; x=1739814615; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2tIHDOPF0PNls1nT25rio5qx/bjBew1n2yApk83FuUI=; b=uiuqKL/r0L6+BcKKRD2kI1JXL3/EQUAVHU2s8hlViVmRt7SMsvgjZ3Sg+pFtCnPaP7 QfxJApXi3xKvlNpq0caKbpgkiz7K3Ue79576hyQqoAUT98HZ4M/9JhNVLsjctldJfSRi Wj0ZheAYmsbCcR7Oi9I5iAII6jXoRx8PDRZTTKgiRyxPgS95AZ/sJAVL10BCKqbXBzoh kIYAMfrNTLB5kQyVaLFd3opVaRDujUYJSRgwoxB4s29sTgRfhacshB1V36GgrMP3v/t3 LMh1cM46piXmlGYMb4q/0IxfVzXAVaBn14F3CptupsKFCNHRknVnELf7YIaHJbAXRwXG htnQ== X-Gm-Message-State: AOJu0YyySkSet6cyHB2wt8Qg4tsrWS8QqHZ8jtTnni7luQyMJt+SyQpQ ogbjW/RqU3gOKupkjW26pBvWik0fZC46vs0Fz4DVmB26mknuyJNA+GgXE5D/s9BAChQ4xA== X-Google-Smtp-Source: AGHT+IHAUj/EzxRvKtgJ7QJN3LKDxgNe/A0xr0/YERyNf+9C200o4bBPmgSHauUpcJYocmkxvKfPsVKl X-Received: from wmqd4.prod.google.com ([2002:a05:600c:34c4:b0:439:4c13:57e5]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:1883:b0:385:f7ef:a57f with SMTP id ffacd0b85a97d-38dc9233968mr11826038f8f.27.1739209814970; Mon, 10 Feb 2025 09:50:14 -0800 (PST) Date: Mon, 10 Feb 2025 18:49:49 +0100 In-Reply-To: <20250210174941.3251435-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250210174941.3251435-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=2573; i=ardb@kernel.org; h=from:subject; bh=f8GMXZVc+ZgqfzipyO2wKCTDym84g0qfwV9FVQOEoyI=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIX2VjfW5siSre++kNEo+q6+8viNWfFN8/+R3PvYS7nNvr 55w3Um7o5SFQYyDQVZMkUVg9t93O09PlKp1niULM4eVCWQIAxenAEyk6wQjw1olLrm/vxfb6H+u kegTlJXMky4WvijZf2PV6t8O07gijzEyNF955r9ATrrvxU37RbOPae2Ovuw9wf0A88JtW90XOB7 ZywIA X-Mailer: git-send-email 2.48.1.502.g6dc24dfdaf-goog Message-ID: <20250210174941.3251435-16-ardb+git@google.com> Subject: [PATCH v2 7/7] x86/efi/mixed: Move mixed mode startup code into libstub From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, hdegoede@redhat.com, Ard Biesheuvel Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel The EFI mixed mode code has been decoupled from the legacy decompressor, in order to be able to reuse it with generic EFI zboot images for x86. Move the source file into the libstub source directory to facilitate this. Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/Makefile = | 1 - drivers/firmware/efi/libstub/Makefile = | 3 +++ arch/x86/boot/compressed/efi_mixed.S =3D> drivers/firmware/efi/libstub/x86= -mixed.S | 0 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/M= akefile index f2051644de94..fc5563704466 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -104,7 +104,6 @@ vmlinux-objs-$(CONFIG_INTEL_TDX_GUEST) +=3D $(obj)/tdx.= o $(obj)/tdcall.o $(obj)/td vmlinux-objs-$(CONFIG_UNACCEPTED_MEMORY) +=3D $(obj)/mem.o =20 vmlinux-objs-$(CONFIG_EFI) +=3D $(obj)/efi.o -vmlinux-objs-$(CONFIG_EFI_MIXED) +=3D $(obj)/efi_mixed.o vmlinux-libs-$(CONFIG_EFI_STUB) +=3D $(objtree)/drivers/firmware/efi/libst= ub/lib.a =20 $(obj)/vmlinux: $(vmlinux-objs-y) $(vmlinux-libs-y) FORCE diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/l= ibstub/Makefile index 1141cd06011f..903afd2d3d58 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -62,6 +62,8 @@ KBUILD_CFLAGS :=3D $(filter-out $(CC_FLAGS_LTO), $(KBUILD= _CFLAGS)) # `-fdata-sections` flag from KBUILD_CFLAGS_KERNEL KBUILD_CFLAGS_KERNEL :=3D $(filter-out -fdata-sections, $(KBUILD_CFLAGS_KE= RNEL)) =20 +KBUILD_AFLAGS :=3D $(KBUILD_CFLAGS) -D__ASSEMBLY__ + lib-y :=3D efi-stub-helper.o gop.o secureboot.o tpm.o \ file.o mem.o random.o randomalloc.o pci.o \ skip_spaces.o lib-cmdline.o lib-ctype.o \ @@ -83,6 +85,7 @@ lib-$(CONFIG_EFI_GENERIC_STUB) +=3D efi-stub.o string.o i= ntrinsics.o systable.o \ lib-$(CONFIG_ARM) +=3D arm32-stub.o lib-$(CONFIG_ARM64) +=3D kaslr.o arm64.o arm64-stub.o smbios.o lib-$(CONFIG_X86) +=3D x86-stub.o smbios.o +lib-$(CONFIG_EFI_MIXED) +=3D x86-mixed.o lib-$(CONFIG_X86_64) +=3D x86-5lvl.o lib-$(CONFIG_RISCV) +=3D kaslr.o riscv.o riscv-stub.o lib-$(CONFIG_LOONGARCH) +=3D loongarch.o loongarch-stub.o diff --git a/arch/x86/boot/compressed/efi_mixed.S b/drivers/firmware/efi/li= bstub/x86-mixed.S similarity index 100% rename from arch/x86/boot/compressed/efi_mixed.S rename to drivers/firmware/efi/libstub/x86-mixed.S --=20 2.48.1.362.g079036d154-goog