From nobody Thu Dec 05 00:18:50 2024 X-Original-To: dev-commits-src-main@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 4Y3ZkL6BQVz5gRSB; Thu, 05 Dec 2024 00:18:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y3ZkL5fClz4b5C; Thu, 5 Dec 2024 00:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733357930; 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=hOhnEuzSIQ4yFwu4YNurNNWvltgmvndLqjelrbr59vY=; b=ldzfjTUSe1XUbUS8O3FFZ4QbeweSLy2U4TCl4kpKFaIA1yVomv5ND2XBEtMwqyI2xtT4ar F11nxYEnnSwcqgjT9KmDWIxahILhxURI634UIe1/Wc2JzU20Jg0vaO+Yz/3bIQvAbOQKqS lIMyxqI1SwnY13TFgDkzrZhQ2yxO4XyD6+aqcSvvYdAKD+FpCbVzrajwcQ3U0gm8+wx6ou VgJywCQ8lUE6zWcuhXAj4ANpMvyLA76HcRg81gAgv41PC1hsiZ08DcF2R80ekBVVvO1I4c JceLPDts9GEbzycXFXXfYHgBI6aS/Sbz+SB/9eKYFXet5ZKhL/op6CB1/Q2GWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733357930; 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=hOhnEuzSIQ4yFwu4YNurNNWvltgmvndLqjelrbr59vY=; b=hWH9e9ZJD7ZokZ0hmO6g4a7ytFrAUprkoLEzUDufitcEyaUjGnAPgz7jomjCv70diAr5K1 H2xteNfoKzRp2sROXmJ+wjPtvjX0CQBNIikAppeI8BtZ93tVKPde5K7bLid9Fau9EROz9o zfWZbscXX3ObtYx3ZypZFA8Y7YPD6UpbLVi5OrFYdaUeF3RChZDBtTHoc/aZKO5b6etQ91 OyZdHMpDN5oTxzFhSPvXoNcvbM140Wkcg/WAxaNzCp2u+ez42+UmddPESgeIwLYnKQgF+o gQwBytFKYILhXrum7BFoA5LX0y0atcgHI8PWhG9eeW4VPtFTofKqMP/rpuuOVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733357930; a=rsa-sha256; cv=none; b=wHAxTNcpVmRqru9F4tjppY1zhxkKorLvsmAFpC+n7K+Ohk+E+ct48pL1PHFE8Gw6y8GKF+ 1dCuE6iq8VHKFqqKMcBHX6zZr6yIiftmxn/7Ut1+u8+pIlQPmw/VIjED9wbEdWAlaVLh1B mZnEh2tGStUeHxA440o1pZf1ud8B8iZaAkzzT/vioR4sSl4GBK+hcHzE8nSxGM0j55836o blSbRm6U2ONxkJeQ6VZbkX6PYWZ7/9sysFlkAKyh3xKiWnkCOqPhUz+o54EqBlquQmK5S6 sFMCXgqeTtO2L/nADwJuBMSGzlq9HkSjMjJ8ucLFguwH4oFaiDRZVWI4EAbmrA== 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 4Y3ZkL5FXczVD0; Thu, 5 Dec 2024 00:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B50IoI4013232; Thu, 5 Dec 2024 00:18:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B50IohN013229; Thu, 5 Dec 2024 00:18:50 GMT (envelope-from git) Date: Thu, 5 Dec 2024 00:18:50 GMT Message-Id: <202412050018.4B50IohN013229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9e239e67c460 - main - stand: further restrict f_kernphys_relocatable and f_tg_kernel_support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 9e239e67c460c5ad9878a000c4c63d4154cb21af Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9e239e67c460c5ad9878a000c4c63d4154cb21af commit 9e239e67c460c5ad9878a000c4c63d4154cb21af Author: Ahmad Khalifa AuthorDate: 2024-09-27 15:32:06 +0000 Commit: Warner Losh CommitDate: 2024-12-05 00:19:17 +0000 stand: further restrict f_kernphys_relocatable and f_tg_kernel_support f_tg_kernel_support isn't used by any EFI code, and f_kernphys_relocatable isn't used by the non-EFI i386 code. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1446 --- stand/common/bootstrap.h | 4 ++-- stand/common/load_elf.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index ab1e5249fc2a..37cef2956f40 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -239,10 +239,10 @@ struct preloaded_file size_t f_size; /* file size */ struct kernel_module *f_modules; /* list of modules if any */ struct preloaded_file *f_next; /* next file */ -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && defined(EFI)) bool f_kernphys_relocatable; #endif -#if defined(__i386__) +#if defined(__i386__) && !defined(EFI) bool f_tg_kernel_support; #endif }; diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index eaa6bef6ee86..d3775b9f0017 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -217,7 +217,7 @@ static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) } #endif -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && defined(EFI)) static bool is_kernphys_relocatable(elf_file_t ef) { @@ -491,10 +491,10 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, /* Load OK, return module pointer */ *result = (struct preloaded_file *)fp; err = 0; -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && defined(EFI)) fp->f_kernphys_relocatable = multiboot || is_kernphys_relocatable(&ef); #endif -#ifdef __i386__ +#if defined(__i386__) && !defined(EFI) fp->f_tg_kernel_support = is_tg_kernel_support(fp, &ef); #endif goto out;