From nobody Tue Apr 16 20:12:54 2024 X-Original-To: dev-commits-src-all@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 4VJwFg0TcRz5H0gt; Tue, 16 Apr 2024 20:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VJwFf53JNz4t79; Tue, 16 Apr 2024 20:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713298374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kny40haFki/fpDXrs46vcYrlnYHS/Q9/enBoZ7HoMs8=; b=Bmoh4o9DA8sp0Om65gOqMBpDPY372JC7DGjVgWerKpk8fD4kHecYNUU3YDJvn9EVhbAjFj 8zjn+tB9VjRdPQZXAsDnQ5ITso1rkaXcxxYJUhnhNuUbXaEkunDVRHkBYhpYnSo17nIY9g ys92NJPNtIdOl2jpfqM9R2nbJJBefALhSZaK/oGJrbsiFDSoB3w3X8NLumYt52X1u8X7mh mSGqZv6gywk7vmkK024ivr3oH2S7zbspyYZhOoe4Ls1atU+4XtrtDTEQwQ6ViTEe9r1dPV g0rJDsqVux8ExsUUcq9tgJ75u95ONLcJXKjcmyd2J3Bk07kALQZnf4d8+WDKvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713298374; a=rsa-sha256; cv=none; b=LVDzg2WNnztiVDL4xJy4Z9e5IxZLLS56/tmLieAm8BAyUs4Q2iZmdZXpU1THA58X71IC3V XLaqUKBgxRgirw7/lrvg2O1twhAdMxWFhs+Pwt8CnRfZk5mSyAKY0uORx+yEpDfnA+0bbs FEQTwYmpKBlTeXyTwZr6Fvo7fBlsAyXRdGamMrou0OGs9gs1JwkSRh8VfrCC7Bll72U9l7 oLwmlsVYVNfnvhMpc7GQWQJkq2iUt367X0FtVkdt1qorGTDI6YNJi3znRzwmiVjU4Y24gl nZ4f6Nj4LUJC1T9bVavCTAgdGJI5Zla7p9ZvOHDAhCJy06P7Vg5/TZ3FW7dJbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713298374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kny40haFki/fpDXrs46vcYrlnYHS/Q9/enBoZ7HoMs8=; b=waNHFOMdTo+TLKPkzP3kMIAQLRTzqhNDPZRsXV5UUsrdNUCRT+MwV1GjD/gRYEHHAVmdl5 o4v8nymSfWofkPZ7L7/UyoeVM938POZSFhI1WrPhA1OcyYvIBKoi8wBBp2e99GnPvpPxqj XBnmrH2UIaKO8dEtk3PO79nSW8a2Mp2jObOX8wZDyDIJgHBY3b3e6DSBwn51joHgDBAcii 41hWyA48q9pbqaYe16OgE6u5aW/c7r6i9PcLueX7Nssos1CIN2ExHpRL8oHazXQkGJHH49 oyhDHAuNos+4LekHeKn1C/1nVS+wKzg5P2CrOj6YvXi3qpMSQbGQZ2HcZKctzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VJwFf4d1PzxJV; Tue, 16 Apr 2024 20:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43GKCsNv038200; Tue, 16 Apr 2024 20:12:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43GKCssm038197; Tue, 16 Apr 2024 20:12:54 GMT (envelope-from git) Date: Tue, 16 Apr 2024 20:12:54 GMT Message-Id: <202404162012.43GKCssm038197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: c34c7f78c751 - stable/14 - loader: Simplify build a little List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c34c7f78c751fc594fedaeab85368bd8fd91e405 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c34c7f78c751fc594fedaeab85368bd8fd91e405 commit c34c7f78c751fc594fedaeab85368bd8fd91e405 Author: Warner Losh AuthorDate: 2024-02-16 03:55:05 +0000 Commit: Warner Losh CommitDate: 2024-04-16 19:54:24 +0000 loader: Simplify build a little Confine -DDISK_DEBUG to biosdisc.c, the only file it affects. Use modern variable arrays instead of alloca and add a sanity size minimum for biospnp nodes. These nodes are tiny enough that we needn't do a malloc/free pair: the stack is fine. Sponsored by: Netflix Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D43914 (cherry picked from commit 588ff0748f4acf8e00395f86e4956f184c7d3795) --- stand/i386/libi386/Makefile | 8 ++------ stand/i386/libi386/biospnp.c | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/stand/i386/libi386/Makefile b/stand/i386/libi386/Makefile index 0bc0efd35f22..fcba20fa26c4 100644 --- a/stand/i386/libi386/Makefile +++ b/stand/i386/libi386/Makefile @@ -23,7 +23,7 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} .ifdef(BOOT_BIOSDISK_DEBUG) # Make the disk code more talkative -CFLAGS+= -DDISK_DEBUG +CFLAGS.biosdisk.c+= -DDISK_DEBUG .endif # terminal emulation @@ -35,11 +35,7 @@ CFLAGS.teken.c+= -I${SRCTOP}/sys/teken CFLAGS.bootinfo.c+= -I${SRCTOP}/sys/teken -I${SRCTOP}/contrib/pnglite CFLAGS.vbe.c+= -I${SRCTOP}/sys/teken -I${SRCTOP}/contrib/pnglite -# XXX: make alloca() useable -CFLAGS+= -Dalloca=__builtin_alloca - -CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ - -I${LDRSRC} -I${BOOTSRC}/i386/common \ +CFLAGS+= -I${LDRSRC} -I${BOOTSRC}/i386/common \ -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers diff --git a/stand/i386/libi386/biospnp.c b/stand/i386/libi386/biospnp.c index 7e3bc97a35ee..a26c0d4d52d8 100644 --- a/stand/i386/libi386/biospnp.c +++ b/stand/i386/libi386/biospnp.c @@ -155,6 +155,7 @@ biospnp_enumerate(void) { uint8_t Node; struct pnp_devNode *devNodeBuffer; + uint8_t buffer[max(pnp_NodeSize, sizeof(*devNodeBuffer))]; int result; struct pnpinfo *pi; int count; @@ -163,7 +164,7 @@ biospnp_enumerate(void) if (biospnp_init()) return; - devNodeBuffer = (struct pnp_devNode *)alloca(pnp_NodeSize); + devNodeBuffer = (struct pnp_devNode *)buffer; Node = 0; count = 1000; while((Node != 0xff) && (count-- > 0)) {