From nobody Tue Jan 24 22:13:55 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 4P1h834NlKz3bgh1; Tue, 24 Jan 2023 22:13: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 4P1h833rvVz3K42; Tue, 24 Jan 2023 22:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598435; 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=xhQAh3Rucf+/jNeOG+ThPDpXVBl1T91h4NNzfQFkYDE=; b=YD15im7Prm07cBbT8Qp3n1tibhaL5g6X3TMJaoeMTAA3MyklcGBkloSKdQBN4rj14tijQx aJZtj98SQQh8us9ebEbGoIZtusy0kU/bEjj4VKd69k1TMHx5yhn4UunVWdSUD8KzRVM7pk 28JBu0uAeDAi5Gyxi6Q8dmfbHZS1E074C+cuy5JaLAuaopD324lOrh2gvipxLyN7CnMsz+ 4+tGvy4947WYFVrNdDgnsQ4H5E4bEeZ7OG/lW8jAOS5gpz/XzxCMrQ7OWd/kvOh6FeWdhC 8Yjph+z/5S0zU0GLD8W0SyNSfb3ejewp6L3N9UAePzE5DGibf2nUghH/nAgxbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598435; 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=xhQAh3Rucf+/jNeOG+ThPDpXVBl1T91h4NNzfQFkYDE=; b=rPhlBNsQ3bNX8R8ex+dNr8S6LtgIPFnxnr+oLF5YLwM1DzaQl/z/Bs4ftP9CZ/FS085ZeK kvfEIuRhLdySSBAHQNkXAmpzO5ZZ/saC0Ah+5aWecOfVfsaLZ2lamnhStybe4RHRtmAVOW DwtnnbBVPCHAIbeigJUN6epHWI1iNDJTk2+UntUdmMTb8sxHxF7viUHjF+E1uNfgpDKAkr LDItUaTkHa7AZqITZ4bAuZhlT5yK1pbvlYgKSab0VC+iz/xURk3KKRrFRY4PMUTtYbS1T+ UzY2DBtv7l2hsV3ENHqM0gNey4essad94cEOghmdLL3o4kCJTOo/ektbH4ZUkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598435; a=rsa-sha256; cv=none; b=JHUGPQu2sNoanCWOy0BiRuyW3KpUhLDL0IeLpafUWmoFlRhTiGOKm0/ZsVJLrRLK0xthOG KXqHzFy+CQVHcnBcernmyO/gkJuSbZ99OCJDNRHBkpI2/6h+JMkReDJH9yXeees/XhT4nd w0mXiND52VsmhZvlI7g3vhZgatmUafpJRaXfEDhjva0cuI51vh45iLIP2HjaeA6q3tOogJ LW9fD2NC0WhVKe7Sp9vGAAg1qkiaMHQi/xoLk6wx6Gj7bj6m+aKq0CODf0WpTWgSjEmtJ+ euOX0c3GnKJDvnPOMkCqIBAAjH++mi3HeD7FAXqYHZ6vrC7MoclF3wEPr/2A4A== 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 4P1h832tLGzQW0; Tue, 24 Jan 2023 22:13:55 +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 30OMDtSj089099; Tue, 24 Jan 2023 22:13:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMDtTt089098; Tue, 24 Jan 2023 22:13:55 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:13:55 GMT Message-Id: <202301242213.30OMDtTt089098@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: 0d805f0f6f25 - stable/13 - kboot: Add md_addr to 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: 0d805f0f6f25cc18faf46ae729d8e1b06e7dea66 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0d805f0f6f25cc18faf46ae729d8e1b06e7dea66 commit 0d805f0f6f25cc18faf46ae729d8e1b06e7dea66 Author: Warner Losh AuthorDate: 2022-12-04 20:52:22 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:43 +0000 kboot: Add md_addr to metadata Save the address of where the metadata is loaded. Sponsored by: Netflix (cherry picked from commit 9f7269677c5e70283a16887e1e4b4a1ed95a96fb) --- stand/common/bootstrap.h | 1 + stand/common/modinfo.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index cb1c96dc3b69..bbe97e80323b 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -201,6 +201,7 @@ struct file_metadata { size_t md_size; uint16_t md_type; + vm_offset_t md_addr; /* Valid after copied to kernel space */ struct file_metadata *md_next; char md_data[1]; /* data are immediately appended */ }; diff --git a/stand/common/modinfo.c b/stand/common/modinfo.c index 0c00b2070274..381bd9dfd719 100644 --- a/stand/common/modinfo.c +++ b/stand/common/modinfo.c @@ -95,8 +95,10 @@ #define MOD_METADATA(a, mm, c) { \ COPY32(MODINFO_METADATA | mm->md_type, a, c);\ COPY32(mm->md_size, a, c); \ - if (c) \ + if (c) { \ archsw.arch_copyin(mm->md_data, a, mm->md_size);\ + mm->md_addr = a; \ + } \ a += MOD_ALIGN(mm->md_size); \ }