Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Apr 2021 21:51:41 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4d221f59b851 - main - fbt: Remove some handling for multiple CTF containers
Message-ID:  <202104022151.132Lpft3027230@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=4d221f59b851a9c844c84701bab7f4edb7026bd4

commit 4d221f59b851a9c844c84701bab7f4edb7026bd4
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-04-02 21:42:26 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-04-02 21:49:13 +0000

    fbt: Remove some handling for multiple CTF containers
    
    This was ported from illumos but not completely done.  Currently we do
    not perform type deduplication between KLDs and the kernel, i.e., kernel
    modules have a complete type graph.  So, remove it for now since it's
    not functional and complicates the task of modifying various CTF type
    definitions, and we are hitting some limits in the current format which
    necessitate an update.
    
    No functional change intended.
    
    MFC after:      2 weeks
---
 sys/cddl/dev/fbt/fbt.c | 44 +++++++++-----------------------------------
 1 file changed, 9 insertions(+), 35 deletions(-)

diff --git a/sys/cddl/dev/fbt/fbt.c b/sys/cddl/dev/fbt/fbt.c
index a378ae0eb317..3bad4243c040 100644
--- a/sys/cddl/dev/fbt/fbt.c
+++ b/sys/cddl/dev/fbt/fbt.c
@@ -474,17 +474,18 @@ fbt_typoff_init(linker_ctf_t *lc)
 	int ctf_typemax = 0;
 	uint32_t *xp;
 	ulong_t pop[CTF_K_MAX + 1] = { 0 };
+	uint8_t version;
 
 
 	/* Sanity check. */
 	if (hp->cth_magic != CTF_MAGIC)
 		return (EINVAL);
 
+	version = hp->cth_version;
+
 	tbuf = (const ctf_type_t *) (ctfdata + hp->cth_typeoff);
 	tend = (const ctf_type_t *) (ctfdata + hp->cth_stroff);
 
-	int child = hp->cth_parname != 0;
-
 	/*
 	 * We make two passes through the entire type section.  In this first
 	 * pass, we count the number of each type and the total number of types.
@@ -495,9 +496,8 @@ fbt_typoff_init(linker_ctf_t *lc)
 		ssize_t size, increment;
 
 		size_t vbytes;
-		uint_t n;
 
-		(void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment);
+		(void) fbt_get_ctt_size(version, tp, &size, &increment);
 
 		switch (kind) {
 		case CTF_K_INTEGER:
@@ -512,22 +512,10 @@ fbt_typoff_init(linker_ctf_t *lc)
 			break;
 		case CTF_K_STRUCT:
 		case CTF_K_UNION:
-			if (size < CTF_LSTRUCT_THRESH) {
-				ctf_member_t *mp = (ctf_member_t *)
-				    ((uintptr_t)tp + increment);
-
+			if (size < CTF_LSTRUCT_THRESH)
 				vbytes = sizeof (ctf_member_t) * vlen;
-				for (n = vlen; n != 0; n--, mp++)
-					child |= CTF_TYPE_ISCHILD(mp->ctm_type);
-			} else {
-				ctf_lmember_t *lmp = (ctf_lmember_t *)
-				    ((uintptr_t)tp + increment);
-
+			else
 				vbytes = sizeof (ctf_lmember_t) * vlen;
-				for (n = vlen; n != 0; n--, lmp++)
-					child |=
-					    CTF_TYPE_ISCHILD(lmp->ctlm_type);
-			}
 			break;
 		case CTF_K_ENUM:
 			vbytes = sizeof (ctf_enum_t) * vlen;
@@ -552,7 +540,6 @@ fbt_typoff_init(linker_ctf_t *lc)
 		case CTF_K_VOLATILE:
 		case CTF_K_CONST:
 		case CTF_K_RESTRICT:
-			child |= CTF_TYPE_ISCHILD(tp->ctt_type);
 			vbytes = 0;
 			break;
 		default:
@@ -584,9 +571,8 @@ fbt_typoff_init(linker_ctf_t *lc)
 		ssize_t size, increment;
 
 		size_t vbytes;
-		uint_t n;
 
-		(void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment);
+		(void) fbt_get_ctt_size(version, tp, &size, &increment);
 
 		switch (kind) {
 		case CTF_K_INTEGER:
@@ -601,22 +587,10 @@ fbt_typoff_init(linker_ctf_t *lc)
 			break;
 		case CTF_K_STRUCT:
 		case CTF_K_UNION:
-			if (size < CTF_LSTRUCT_THRESH) {
-				ctf_member_t *mp = (ctf_member_t *)
-				    ((uintptr_t)tp + increment);
-
+			if (size < CTF_LSTRUCT_THRESH)
 				vbytes = sizeof (ctf_member_t) * vlen;
-				for (n = vlen; n != 0; n--, mp++)
-					child |= CTF_TYPE_ISCHILD(mp->ctm_type);
-			} else {
-				ctf_lmember_t *lmp = (ctf_lmember_t *)
-				    ((uintptr_t)tp + increment);
-
+			else
 				vbytes = sizeof (ctf_lmember_t) * vlen;
-				for (n = vlen; n != 0; n--, lmp++)
-					child |=
-					    CTF_TYPE_ISCHILD(lmp->ctlm_type);
-			}
 			break;
 		case CTF_K_ENUM:
 			vbytes = sizeof (ctf_enum_t) * vlen;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104022151.132Lpft3027230>