From nobody Tue Jan 24 22:09:40 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 4P1h391T9Jz3bdRK; Tue, 24 Jan 2023 22:09:41 +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 4P1h39059Gz4GYc; Tue, 24 Jan 2023 22:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598181; 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=vH2rC+WXzJ7nyBCiKiBUdY3SgCx9787BzjrC/WyH8iU=; b=e3KGcRdonQnGJ4ZFFr9RuM2GoEoHBcLP6HxRSK1l+uKffTkwzZ+UE3DZ6gx4wisEaBIOgl 9Z4uu4tuQ4NvB41J8AyHxEWXByi67axxCpOTbqJ8NFEaWfbqHzFi+MCfJ4hd6/LQz2yuNv /7y0Be0zPnjKXR52ilOM3e702VjVvqAd5VLpizwjxn0vVf9YjI0+ZsV8iGtcRdtHmxQEBe aSmM55cLwtFRBT1eliVsu2nm7JRRapbiW/rRfVOFwrETSpI8l6yF+fFx2WxrsQrmzY3kvj yjaZ/pb5D2g7+c0NIM6IFhoSdfY3rCrL065f5Jgiw4rhdBxtJjAbmXyHqgUWuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598181; 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=vH2rC+WXzJ7nyBCiKiBUdY3SgCx9787BzjrC/WyH8iU=; b=I0V6tg9H0en/m9XIZWbeBvMtrK98aSPBp40INOhPjgiS6rWaGezLYr7JJEUie33gQMLo2j +NZO7R1fi8VFBzoFx41AvnaVPLqweWAwTmRmwxP6JPOqdm0hlMJWcHRw7GPel1Fxo/zePO wC0plRA5dl3jJdKaRiXVkOAd1u2wX/1DY1ilwAeEdpLpyNLxjBjV7wk9WoY/UJPco89Isc RX25UAgT0576UNCKUIRlPHlD07Q/mf1aDkjLthfkbbFVP8g8yHKNcgnC6ONvsO4r0yliOj i0W2cc78Dt0eTMXIucueRJ6Y+1GqhKAvTG9kodYGZtHbd0O0MR9esEvUa25uoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598181; a=rsa-sha256; cv=none; b=Nd/tl4Uo1hL9DjhKfKTzopnlxBGLLvjOd9TJnCJ2YG0uUbJ2SyHMEi0B1PyiO82LknLtVn Z/ClvIy+AxQy2ACJZppbAeHv820Or19JnRE5p7BnjF8PF2XhWtp64//SwVNbwGLNTUEMvf i41fs0c7OhKlLPLEiJ63qAI7goc+1Kh/aZ6dDLqQ3Fq63cGy2E1PDNKg5+x6u+igrl0p2G ty+QGVr/nHfrC9szCnc5xr252LO/8L13sM69InEIFAQAL1dfJvQtSR+OzqmyEpf0j4VI/q XhZx0RVJ82qqAnEauf/onak2l3uBjiKBf7gKstz7qazq78ffmOrldoZO4hG9Rw== 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 4P1h385hqyzQT4; Tue, 24 Jan 2023 22:09:40 +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 30OM9eZf070492; Tue, 24 Jan 2023 22:09:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OM9eft070491; Tue, 24 Jan 2023 22:09:40 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:09:40 GMT Message-Id: <202301242209.30OM9eft070491@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: 8f6f1e27fd18 - stable/13 - stand/efi: add modulep to kernel metadata 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8f6f1e27fd187622edcbd7c8d3b36ffa6bbdba70 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8f6f1e27fd187622edcbd7c8d3b36ffa6bbdba70 commit 8f6f1e27fd187622edcbd7c8d3b36ffa6bbdba70 Author: Roger Pau Monné AuthorDate: 2021-02-05 10:11:36 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:16 +0000 stand/efi: add modulep to kernel metadata This mirrors the functionality of the BIOS amd64 bi_load function, that stashes the absolute address of the module metadata. This is required for booting as a Xen dom0 that does relocate the modulep and the loaded modules, and thus requires adjusting the offset. No functional change introduced, further patches will make use of this functionality for Xen dom0 loading. Sponsored by: Citrix Systems R&D Reviewed by: imp Differential revision: https://reviews.freebsd.org/D28496 (cherry picked from commit 7d3259775cb69f250df3e7fe51d6fff2283c6f20) --- stand/efi/loader/bootinfo.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 1a6de233b8cf..74be4f8f5d74 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -440,7 +440,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) struct devdesc *rootdev; struct file_metadata *md; vm_offset_t addr; - uint64_t kernend; + uint64_t kernend, module; uint64_t envp; vm_offset_t size; char *rootdevname; @@ -519,6 +519,10 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ + + /* Figure out the size and location of the metadata. */ + module = *modulep = addr; + file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof(howto), &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof(envp), &envp); #if defined(LOADER_FDT_SUPPORT) @@ -529,14 +533,13 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) "device tree blob found!\n"); #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof(kernend), &kernend); + file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module); file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST); #ifdef LOADER_GELI_SUPPORT geli_export_key_metadata(kfp); #endif bi_load_efi_data(kfp, exit_bs); - /* Figure out the size and location of the metadata. */ - *modulep = addr; size = bi_copymodules(0); kernend = roundup(addr + size, PAGE_SIZE); *kernendp = kernend;