From nobody Tue Nov 18 04:51:37 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4d9XJs1Zkjz6GN7Y for ; Tue, 18 Nov 2025 04:51:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d9XJr1PVkz3kD1 for ; Tue, 18 Nov 2025 04:51:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=TRxHyNgH; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::630) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-298145fe27eso67697665ad.1 for ; Mon, 17 Nov 2025 20:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1763441509; x=1764046309; darn=freebsd.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=EHZ/ICgOxhhMF4ALK68KpCcYx2C8fFgISbtrpURYVWI=; b=TRxHyNgHz1cGenJ9QJho+KyYvSRq7lhmgOlJ0zkZyLzRSWHrsRJ0feNcLlNGwqqfs+ lO0UONmkfhQj/ekfzXXPvqG7bFiSfYz+Pk2bGxr+f44o+GFMf9WdLbK43rjAYPS2/0ll xqAmq6FePAjkurf2KhZX9eVkNmQF4UeugqginKU70xkR3uA6FYVnqI42coTp6lvszNJF Hi3X9QYZ2lFzz9VxJkYEjVhIsGBJUUzf0VElP1lpJDGRKcj1+KNyVCpddeau8JBfIfmn QSPWE8lXYwqwknIFXvt8Aw4qkg771+h7Po46MU4R0006yQNHH6DKM40gSz7lzEtSBpix cpVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763441509; x=1764046309; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EHZ/ICgOxhhMF4ALK68KpCcYx2C8fFgISbtrpURYVWI=; b=ibaU5oxuFby4iCBtx+C5pl19QmA1LJuPxy0R4491rTY4m5jt+SffCU98TZMw+5z8Hz P5z3sH5YP8oeJBg4zsTV4C1SQsbI9XZpVlbih27DmTE7+Vm6vGVnOtSK08dTfRqEYjZB eHfWeMl9pK2nlsEK0l3FDH5qGDQricvt+rOc1Iwx37hkcC+5LWUefGXfPHAwsSzfj80m VGGblKxPqNn1px0C7plWE9GrQAv83o/M9HILzlxL8g7MiWgWW+OIRGdUY/fkC8PMUckg 7ooD6DyZ+ahSsh7OAn8+nNKUomoPGSopYVGC97R66S2AS9L/uOMkHfzRkmbPz9EpGszd eMEg== X-Gm-Message-State: AOJu0YxB6S5aEnUc9TWrw+fb6iyyjUgRKMEYAl9avmZbgtKw7ymWbNdo TkSw3LO94R703XOyjkGdgqVY5jrdRupfLPOmNTuwmXcLgSrjcqYIWTuT6dWaKW8/GRDgtsIqXLa DA/sEIFrGBLtULJcWGxSxuq8JdlRY4yijV5ItLjicD4sSmDdvRWmlppQ= X-Gm-Gg: ASbGncs1vzBD4MMuvDcnkP4MuYWkWuYtZlFZyzNULdNdaaduO8p3/OlDnZWHOrL9nMu Wqgjj+rt02PZS9dYYOodqg8AwEDihz4Z2fGWMjiXtiaB3W97CG8rFyQtW0ilkx8XkIyWa5B76vb zHWx/Wwhemf3gD+XM6xSJIanydM7nwPmTZzcZoWE+jnOqFMrRSCC0/0WZHlxJCuInIJdqXYmMk4 O0MmudyOizlkhKEeCv+buDq27rR28VoNFmQlVc0FBFbid8Wuhwiiy0XEIUMJw1GL0DQGRs= X-Google-Smtp-Source: AGHT+IHCQUVk0gstNE6wdlEzTZjfDx+NRiNaA2l0quwHshfP6nfraMDcC3IJpP2uP+8yOs6pxQlO0qYkbEn2kyVRbB0= X-Received: by 2002:a17:903:2b10:b0:297:d777:a2d4 with SMTP id d9443c01a7336-2986a752800mr172554445ad.46.1763441508635; Mon, 17 Nov 2025 20:51:48 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <202511180445.5AI4jnYK085911@gitrepo.freebsd.org> In-Reply-To: <202511180445.5AI4jnYK085911@gitrepo.freebsd.org> From: Warner Losh Date: Mon, 17 Nov 2025 21:51:37 -0700 X-Gm-Features: AWmQ_bnvchPQyxeox6hlTpXtATNqUsTrbldq0lHF2N-paPUx-psuWqb55z7n-fA Message-ID: Subject: Fwd: git: 396b32e801d6 - main - stand: Add back missing EFIAPI define To: FreeBSD Current Content-Type: multipart/alternative; boundary="000000000000b460cd0643d738e4" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.991]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCPT_COUNT_ONE(0.00)[1]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MISSING_XM_UA(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::630:from]; ARC_NA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4d9XJr1PVkz3kD1 --000000000000b460cd0643d738e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Normally I don't forward things like this to -current (It's current after all), but I broke at least the amd64 efi boot loader yesterday and this is the fix for it. My apologies for anybody that got stuck. Warner ---------- Forwarded message --------- From: Warner Losh Date: Mon, Nov 17, 2025 at 9:45=E2=80=AFPM Subject: git: 396b32e801d6 - main - stand: Add back missing EFIAPI define To: , , < dev-commits-src-main@freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3D396b32e801d615954750162a616b4e917= 4b39916 commit 396b32e801d615954750162a616b4e9174b39916 Author: Warner Losh AuthorDate: 2025-11-18 04:44:07 +0000 Commit: Warner Losh CommitDate: 2025-11-18 04:45:59 +0000 stand: Add back missing EFIAPI define EFIAPI has to be defined correctly for amd64, or things won't boot because it uses a different API than we normally use. Normally, this only affects amd64, since all the other archs are basically nothing. Tested on: amd64, aarch64 and armv7 (the frist two by markj and I with differnet test setups). Fixes: 43b8edb32051 Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D53799 --- sys/sys/efi-edk2.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/sys/efi-edk2.h b/sys/sys/efi-edk2.h index 513c56549803..b27b26bd613c 100644 --- a/sys/sys/efi-edk2.h +++ b/sys/sys/efi-edk2.h @@ -41,7 +41,20 @@ typedef void VOID; /* We can't actually call this stuff, so snip out API syntactic sugar */ #define INTERFACE_DECL(x) struct x +#ifdef _STANDALONE +#if defined(__amd64__) +#define EFIAPI __attribute__((ms_abi)) +#endif +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options + #ifdef _MSC_EXTENSIONS + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #else + #define EFIAPI // Substitute expresion to force C calling convention + #endif +#endif +#else #define EFIAPI +#endif #define IN #define OUT #define CONST const @@ -64,11 +77,13 @@ typedef void VOID; #define PACKED /* - * Since we're not compiling for the UEFI boot time (which use ms abi - * conventions), tell EDK2 to define VA_START correctly. For the boot - * loader, this likely needs to be different. + * For userland and the kernel, we're not compiling for the UEFI boot time + * (which use ms abi conventions on amd64), tell EDK2 to define VA_START + * correctly. For the boot loader, we can't do that, so don't. */ +#ifndef _STANDALONE #define NO_MSABI_VA_FUNCS 1 +#endif /* * Finally, we need to define the processor we are in EDK2 terms. --000000000000b460cd0643d738e4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Normally I don't forward things like this to -current = (It's current after all), but I broke at least the amd64 efi boot loade= r yesterday and this is the fix for it. My apologies for anybody that got s= tuck.

Warner

---------- F= orwarded message ---------
From: Warner Losh <imp@freebsd.org>
Date: Mon, Nov 17, 2025 at = 9:45=E2=80=AFPM
Subject: git: 396b32e801d6 - main - stand: Add back miss= ing EFIAPI define
To: <src-committers@freebsd.org>, <dev-commits-src-all@freebsd.org>, <dev-commits-src-main@freebsd.org<= /a>>


The branch main has been updated by imp:

URL:
https://cgit.= FreeBSD.org/src/commit/?id=3D396b32e801d615954750162a616b4e9174b39916
commit 396b32e801d615954750162a616b4e9174b39916
Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-11-18 04:44:07 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-11-18 04:45:59 +0000

=C2=A0 =C2=A0 stand: Add back missing EFIAPI define

=C2=A0 =C2=A0 EFIAPI has to be defined correctly for amd64, or things won&#= 39;t boot
=C2=A0 =C2=A0 because it uses a different API than we normally use. Normall= y, this
=C2=A0 =C2=A0 only affects amd64, since all the other archs are basically n= othing.
=C2=A0 =C2=A0 Tested on: amd64, aarch64 and armv7 (the frist two by markj a= nd I with
=C2=A0 =C2=A0 differnet test setups).

=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 43b8edb32051
=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Netflix=
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markj =C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D53799
---
=C2=A0sys/sys/efi-edk2.h | 21 ++++++++++++++++++---
=C2=A01 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/sys/sys/efi-edk2.h b/sys/sys/efi-edk2.h
index 513c56549803..b27b26bd613c 100644
--- a/sys/sys/efi-edk2.h
+++ b/sys/sys/efi-edk2.h
@@ -41,7 +41,20 @@ typedef void VOID;

=C2=A0/* We can't actually call this stuff, so snip out API syntactic s= ugar */
=C2=A0#define INTERFACE_DECL(x) struct x
+#ifdef _STANDALONE
+#if defined(__amd64__)
+#define EFIAPI=C2=A0 =C2=A0 __attribute__((ms_abi))
+#endif
+#ifndef EFIAPI=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 // Forces EFI calling conventions reguardless of compiler options
+=C2=A0 =C2=A0 #ifdef _MSC_EXTENSIONS
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 #define EFIAPI __cdecl=C2=A0 // Force C callin= g convention for Microsoft C compiler
+=C2=A0 =C2=A0 #else
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 #define EFIAPI=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 // Substitute expresion to force C calling convention
+=C2=A0 =C2=A0 #endif
+#endif
+#else
=C2=A0#define EFIAPI
+#endif
=C2=A0#define IN
=C2=A0#define OUT
=C2=A0#define CONST const
@@ -64,11 +77,13 @@ typedef void VOID;
=C2=A0#define PACKED

=C2=A0/*
- * Since we're not compiling for the UEFI boot time (which use ms abi<= br> - * conventions), tell EDK2 to define VA_START correctly. For the boot
- * loader, this likely needs to be different.
+ * For userland and the kernel, we're not compiling for the UEFI boot = time
+ * (which use ms abi conventions on amd64), tell EDK2 to define VA_START + * correctly. For the boot loader, we can't do that, so don't.
=C2=A0 */
+#ifndef _STANDALONE
=C2=A0#define NO_MSABI_VA_FUNCS 1
+#endif

=C2=A0/*
=C2=A0 * Finally, we need to define the processor we are in EDK2 terms.

--000000000000b460cd0643d738e4--