From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795587376; b=ABmWkoCkqmjA71f40dpj4S4l9Ge3+iylkBwHkemE5RcRx0kphxWn/k9ArkfI73wEbQ9D VoLRxb7gPLyT2I6w7jeTBgG8xf3KgTp39pEi2YhmL9Hf9KgRP6/66yyZ5J3ZopVQuJo7P muL1/nVL8505jYhxWKnjZz3vy6xpPf/nDr5y2lfH5BdMP1NAzOJGg7LfV7zHNyPrnnV4A vkCmNlU30p571xcBJDTGocQsq1XYy7hHFWm35rif4+zAv0lCRpznG4LPN4F6O9vLSDRJs gixWKoCwizismy7j+KR9hkM21VOm5q9xsqbMSpm814TiS/2AwOkZpAJfP2Wfz02ldMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795587376; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=GGDahMitB3LSpaFaJkVUo1Pzx9kbamS5IbDP2+gBQRY=; b=XtUEQbYmuMx2jdR+2D+3+h9Fyp4vlgsW63fRRoVh2TR0xxm/6gRxpqOPQkHZaMQ//ANn VQuhZhlqmCDp9GXNaX8Qk1b+MQNRut+TOCw0pnvd+cqoLjzad5qKN8yfy5zFlpwk9QPtY t1O2fFcmS2DXRzdSzKO2cyjy/RThKG9JN9XYz+9iAgkSudBHsnX1RksIqxVRn41xEDDCB 1XjiO8F2eC/PYCybmuf9EFlZzxHlUIEeYaygmcl0ZUhrgCOzTL/j+9GyjH4TLIpRZz0h0 y90ZEni4ou6qYSLvJsi+8S2V0PQJWDZlACM73ZPkIQikEItYiaGfxtXF2GHhEcQoBkw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=NC8TFIwL; arc=none smtp.remote-ip=74.125.82.72 Received: from mail-dl1-f72.google.com (mail-dl1-f72.google.com [74.125.82.72]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 083FA60A3817 for ; Wed, 25 Nov 2026 06:16:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 083FA60A3817 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--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=NC8TFIwL Received: by mail-dl1-f72.google.com with SMTP id a92af1059eb24-154e9d2d94fso393045c88.0 for ; Tue, 24 Nov 2026 22:16:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1795587375; x=1796192175; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=GGDahMitB3LSpaFaJkVUo1Pzx9kbamS5IbDP2+gBQRY=; b=NC8TFIwLTkPbzeWjMCBEzMycXowBO7nwlg1PQhGSIEdoRdcynFgU3xj0z346DalUvK CclzOOgsc08nnESEFqDQN8grEdC2dvQQay+O8qqF/cXS/Sx/3fHPHv22bsBKHsHYhqhL N7MKQrt38DWZocIKvHgSCP6atdy4p9PvnCrh+EVUWREweUMREZchFqy91Sxrc/M3Gq0x 4IxBXWtMXRPrVFIYr3Tg854QTdurR/WVRTSLuOea9bx7plqd3QRfrjLI4E++6f3fadBC EcD9m8j1xBeixoCWAUp7sngoetkh00EBHTIE3CwevkPOOdyD58gjHWhr5ITeQvpeR1pk iPrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795587375; x=1796192175; h=content-type: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:content-type; bh=GGDahMitB3LSpaFaJkVUo1Pzx9kbamS5IbDP2+gBQRY=; b=idKevQAdUUkA1edPuLjCl55XQQqF2Co80OEhFVq7XNg0shINIo/ZnhUGAxC4PPfBV6 Ldo2B1NghAqt2XMMyaQFRh91E3J6Ke5XvNaOtsBUfYrQ/YBdR1hNG7qhcbuF/RAiHzmY uJHex31K27HidzAwIm6ZUkwfdUMDH8Wd07Ke26zxy+XoxjJ0vtUSGaEf8qj2NQ6DBaJ6 62/dEMhrtDzFtZdbjQoBe6onYsZN2Uh8PUdWeZ8yI5PxXFKALo4igPDcEjS55W4Hu5oG V7AiTbyZbzaFI7NhodyRHAUAwWlRsGGtzg26W9JdIYiO53ItWI4vkvalM0LowOA8NTCN 2ydw== X-Forwarded-Encrypted: i=1; AL+hErG+Wu6W7H85EhEsHZEZPFC3fG8Bm+fW5SKUFQVh95ivnyoKcT5oHZzr5Q8bUwz4K3uvlFdwj0VHqcwR@vger.kernel.org X-Gm-Message-State: APuU4Z/AvkshY6/HIMzCriDTieFVFU3Tv32FS29LA5DXe5ItlfPL3Rui /dKP+FzByYIov0bmpqyNdpxAwJetZlE9rqwr4GpdJYHAtBFlErMyhPANRxASjzRKQAz0Hjpdbk8 Dlgb8ipNRLQ== X-Received: from dloo27-n2.prod.google.com ([2002:a05:7023:a5b:20b0:1b5:8761:cc11]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:b902:b0:1a5:9abb:fdd7 with SMTP id a92af1059eb24-1b556877a2bmr15589113c88.9.1795587374885; Tue, 24 Nov 2026 22:16:14 -0800 (PST) Date: Tue, 24 Nov 2026 22:15:02 -0800 In-Reply-To: <20261125061523.1540234-1-irogers@google.com> X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261125061523.1540234-1-irogers@google.com> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog Message-ID: <20261125061523.1540234-10-irogers@google.com> Subject: [RFC PATCH v2 09/30] efi/libstub: Disable unwind tables in x86 and RISC-V EFI stubs From: Ian Rogers To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: jpoimboe@kernel.org, rostedt@goodmis.org, peterz@infradead.org, mingo@redhat.com, tglx@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, linux-riscv@lists.infradead.org, acme@kernel.org, namhyung@kernel.org, linux-perf-users@vger.kernel.org, mhiramat@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, bpf@vger.kernel.org, nathan@kernel.org, llvm@lists.linux.dev, nsc@kernel.org, linux-kbuild@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, ardb@kernel.org, linux-efi@vger.kernel.org, maz@kernel.org, oupton@kernel.org, kvmarm@lists.linux.dev, shuah@kernel.org, linux-kselftest@vger.kernel.org, indu.bhagat@oracle.com, jremus@linux.ibm.com, wnliu@google.com, dylanbhatch@google.com, Ian Rogers Content-Type: text/plain; charset="UTF-8" Pass -fno-unwind-tables and -fno-asynchronous-unwind-tables when building x86 and RISC-V EFI libstub objects so enabling kernel-wide asynchronous unwind tables under CONFIG_UNWINDER_DWARF_CFI does not emit unwanted .eh_frame sections into the standalone EFI boot stub. Signed-off-by: Ian Rogers --- drivers/firmware/efi/libstub/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index bbab12b8eb4b..19c2822eb302 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -19,7 +19,8 @@ cflags-$(CONFIG_X86) := $(filter-out -mcmodel=kernel \ $(PADDING_CFLAGS), $(cflags-y)) cflags-$(CONFIG_X86_32) += -march=i386 cflags-$(CONFIG_X86_64) += -mcmodel=small -cflags-$(CONFIG_X86) += -fPIC +cflags-$(CONFIG_X86) += -fPIC -fno-unwind-tables \ + -fno-asynchronous-unwind-tables # Nothing enables IBT while the stub runs, so ENDBR would only take space. cflags-$(CONFIG_X86) += $(call cc-option,-fcf-protection=none) @@ -29,7 +30,9 @@ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \ -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \ -DEFI_HAVE_STRCMP -fno-builtin -fpic \ $(call cc-option,-mno-single-pic-base) -cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax +cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax \ + -fno-unwind-tables \ + -fno-asynchronous-unwind-tables cflags-$(CONFIG_LOONGARCH) += -fpie cflags-$(CONFIG_EFI_PARAMS_FROM_FDT) += -I$(srctree)/scripts/dtc/libfdt -- 2.56.1.831.g720f3f5937-goog