From nobody Fri Feb 03 15:50:47 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 4P7g9M4MC6z3kRrH; Fri, 3 Feb 2023 15:50:47 +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 4P7g9M3VkXz3JHG; Fri, 3 Feb 2023 15:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675439447; 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=Z6TasyF35xg6xWjUfydqfjL06IBPzaDAlPbVqdeSz8E=; b=EIdb48SbS5NH2HM/hpGP9YYuxm9pYg1QB4IfpODNYcU3QuHuXW0hNsgzHzIj2n7R/BKX9H JN2hgr+ETyhzStHcBy0XTlqpG70BAwP9Btu9R7KsWzp0sbh4mYHZ2ea5+TQXU0LOx8Sxdz erSvD9LSG8NvA5OAH4x/7DXtOLnT99TyI3CeAAKEXLQN7q3cbsXSb6qazLsYp9T8J0TqRE ByMT5Erl3mAJT1FH4/R+oLGCGWxhbLUz1Qo+3V2V4Ts+85o9awRyzyKuOAhL/b9wQyGQ9E KreHlf4NL5NCd/vjJ8FaUhGI1pzhEY/m2dxuRHVLrKFgttypvCBvULcXlQRDsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675439447; 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=Z6TasyF35xg6xWjUfydqfjL06IBPzaDAlPbVqdeSz8E=; b=BSEnrn9d2ihhBiaHTBb/6w1hVzZJ7Ze+MjwMfKGJOni8xp7dI/Uji6bZYOM2lAk3h5fMVE 42HmIsgcsFNFe/cqtrzUlvA6tURUddEdmHvQXxkXuDOH3wxMTi//3+7OFsptxY3HnSeBAG b2MS+QGuuUFcjRiCSR+LkpTUVs0y7BM5IdX31hmC3hHWUzN68xFu2IH421pafJndtUqM3c j28f4DMvjOrZceePa6xCOU6T3ty6Sm2GjdTZG5+WNSzOjzQUmUaditrWKoQuynkZ7EXTOi 2+8YLD2D/KDgLlrjmDRwQpPSTuoAqTZnUaxanzn3jLx/VgWyLG0gEFHCh8AlYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675439447; a=rsa-sha256; cv=none; b=XOA/zp7WshM67w5P7cb9Nv6H0ZUzGbv4Arvzg/il6ABhVbM9T0a2ruesH/cvZj7KteYBnU M1czhMwH3KJwjR9SsDqGAyfJMf1nx9WfvxQwtKzy5cambqQ0i2AgwqcJanUPmKosyUL3BW PlNnVF0XfygBHe1hvPOJe6Rh1HwqDAKh+SVrkkWnwCjU7t+bbH1vEr+oKQMXdlllreFf6z eIggcSeRUVSb/g+o4/X8UnuNcTiBwX7QwL64SsYRe9GoS6yEO4iR2PqbjcHAZ/Ri4IoV85 mWwF2cRTuEw/CSQHDeHeF27r9YjJ7Ve56cskIdhg6R5yCCu45Wc8Fk0z+rcS+A== 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 4P7g9M2WvwzgQq; Fri, 3 Feb 2023 15:50:47 +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 313Fol26023190; Fri, 3 Feb 2023 15:50:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 313FolVZ023189; Fri, 3 Feb 2023 15:50:47 GMT (envelope-from git) Date: Fri, 3 Feb 2023 15:50:47 GMT Message-Id: <202302031550.313FolVZ023189@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: e49773296c6c - main - kboot: aarch64 bi_loadsmap 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/main X-Git-Reftype: branch X-Git-Commit: e49773296c6ce3a493260456128e090809249fd4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e49773296c6ce3a493260456128e090809249fd4 commit e49773296c6ce3a493260456128e090809249fd4 Author: Warner Losh AuthorDate: 2023-02-03 15:39:46 +0000 Commit: Warner Losh CommitDate: 2023-02-03 15:41:40 +0000 kboot: aarch64 bi_loadsmap Since aarch64 is different, it needs a different smap. We first see if we have the PA of the table from the FDT info. If so, we copy that and quit. Otherwise, we do the best we can in translating the /proc/iomap into EFI Memory Table format. We also send the system table to the kernel. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D38255 --- stand/kboot/arch/aarch64/load_addr.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/stand/kboot/arch/aarch64/load_addr.c b/stand/kboot/arch/aarch64/load_addr.c index ad71a4f9fbb1..ae8a599645c9 100644 --- a/stand/kboot/arch/aarch64/load_addr.c +++ b/stand/kboot/arch/aarch64/load_addr.c @@ -152,3 +152,22 @@ kboot_get_phys_load_segment(void) printf("Falling back to crazy address %#lx\n", s); return (s); } + +void +bi_loadsmap(struct preloaded_file *kfp) +{ + + if (efi_systbl_phys) + file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(efi_systbl_phys), &efi_systbl_phys); + + /* + * If we have efi_map_hdr, then it's a pointer to the PA where this + * memory map lives. The trampoline code will copy it over. If we don't + * have it, we use whatever we found in /proc/iomap. + */ + if (efi_map_hdr != NULL) { + file_addmetadata(kfp, MODINFOMD_EFI_MAP, efi_map_size, efi_map_hdr); + return; + } + panic("Can't get UEFI memory map, nor a pointer to it, can't proceed.\n"); +}