From nobody Thu Jan 05 10:33:49 2023 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 4NnjW14Rpfz2p79w; Thu, 5 Jan 2023 10:33:49 +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 4NnjW13ygQz3Kx2; Thu, 5 Jan 2023 10:33:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672914829; 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=1XTHOFcOJzlVf7PNDl5wM/6umOUkBlZTYrv4C+cWjB4=; b=ZUnWAsMcyQ0JlXSInytmasL90wtFUuIcVaUxAgPxjUJtfJf5v9Qac0v6FwrZDtBmvU/P69 /8tB854ZSRdcpKvQmzaDird0QX67xCiwuw+hRHjigO01rvrsjfXzDlfXJNbBQ1dHTKgP+R Dip2k41RNczX6Rh7ZxMkt3y4az88tvQd5kM2GIXeXLxxXi47JYsj/mu/theEvxYztRuWK/ SFNZLAViZLf3Gvrr534SbWVmXatibRetal6xHUV4jIZ1m7Fv75i6D8HQIBRaCeQMS4jeuS CIBwCIgzVcxZRprCIASS0mfHgnM7B/xRnlvnxQV13qS1rM2dpQbwOeorQ58hpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672914829; 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=1XTHOFcOJzlVf7PNDl5wM/6umOUkBlZTYrv4C+cWjB4=; b=Hyk5jGbhyIShB0IWPmNrnFHug6VlgU1hbHcPaFn5T04bkwhzJ7uoSU+eKzzr3agaw/SyBq P0JdRMLDXYTMZbsQkU/E4vQPWlVM+4AsLnObn1RIqZEplZqLQ9dKUCVBErCKEPzvrKx5nx szuEGf1u2a8b4MGl+IanalI9fD3Jrd4I+tXdGPldbrOwP8VTwhx38O+Q4eQPZ4O9cgDuuA 0bJJvKA9sOlbCklOYXwsxN8VvY0yZEPEYJw6mWbM75t+WLNpxqVVgXImeDkq4W87huHiXc f4c9zg8p+dB2jhgzZW1EMSnflMRzlto27hcEYMGZXMuAVOBqDrqa/6B4Hu9Jdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672914829; a=rsa-sha256; cv=none; b=x2EeQ2oncbvw4cxekx6VH6tImvddPkrTlxRhml31RP49P8FQ5y0JbJn5SMEOQkgRpa8/g9 aX/XbocJiPXG6wbIWOa4e63DLFta0QYNG9uGbt0kh9EGrGhRiJKee/LWX3mkgRrMEAo+qq 6h82tM5BFhzDswWI6eKkW2ohiE9X1SqjtZ9/lyg/a/8kC+jf8P4aGoVUIhdHEHa4mI6JWX sNi2njGcZ3ueEcZGMcIBwGqwzr0+QEw689E8zlvDFK6jS2EJelt1c/bJwTCrWvBf94wciv tDTYITyS9hCTkYii6asbWfaJbCChrKA1TmRR/x5jo7Q0hXIAWx/BUODC4f5k1g== 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 4NnjW131QkznZP; Thu, 5 Jan 2023 10:33:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 305AXnap004059; Thu, 5 Jan 2023 10:33:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 305AXn7A004058; Thu, 5 Jan 2023 10:33:49 GMT (envelope-from git) Date: Thu, 5 Jan 2023 10:33:49 GMT Message-Id: <202301051033.305AXn7A004058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 95fa2e0aee5b - main - loader.efi: make sure kernel image is executable 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95fa2e0aee5b7259cf4bcdea7396c4dff3241173 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=95fa2e0aee5b7259cf4bcdea7396c4dff3241173 commit 95fa2e0aee5b7259cf4bcdea7396c4dff3241173 Author: Robert Clausecker AuthorDate: 2023-01-02 21:12:50 +0000 Commit: Andrew Turner CommitDate: 2023-01-05 09:58:33 +0000 loader.efi: make sure kernel image is executable The Windows Dev Kit 2023 (Volterra) has an UEFI implementation that maps EfiLoaderData pages as non-executable. Map the kernel as EfiLoaderCode to ensure that it can be executed. With this change and another in review, FreeBSD boots to the mountroot prompt if hw.pac.enable = 0 is set in loader.conf(5). Reviewed by: andrew, imp, tsoome Sponsored by: Berliner Linux User Group e.V. Sponsored by: spline / FU-Berlin Differential Revision: https://reviews.freebsd.org/D37931 --- stand/efi/loader/copy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index d5e24439ed49..d7ca5513516b 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -330,7 +330,7 @@ efi_copy_init(void) staging = get_staging_max(); #endif - status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderData, + status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderCode, nr_pages, &staging); if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", @@ -398,7 +398,7 @@ efi_check_space(vm_offset_t end) /* Try to allocate more space after the previous allocation */ addr = staging_end; - status = BS->AllocatePages(AllocateAddress, EfiLoaderData, nr_pages, + status = BS->AllocatePages(AllocateAddress, EfiLoaderCode, nr_pages, &addr); if (!EFI_ERROR(status)) { staging_end = staging_end + nr_pages * EFI_PAGE_SIZE; @@ -415,7 +415,7 @@ before_staging: addr = rounddown2(addr, M(2)); #endif nr_pages = EFI_SIZE_TO_PAGES(staging_base - addr); - status = BS->AllocatePages(AllocateAddress, EfiLoaderData, nr_pages, + status = BS->AllocatePages(AllocateAddress, EfiLoaderCode, nr_pages, &addr); if (!EFI_ERROR(status)) { /* @@ -438,7 +438,7 @@ expand: #if defined(__i386__) || defined(__amd64__) new_base = get_staging_max(); #endif - status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderData, + status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderCode, nr_pages, &new_base); if (!EFI_ERROR(status)) { #if EFI_STAGING_2M_ALIGN