From nobody Sat Sep 09 08:21:16 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 4RjQt52NcRz4sKbt; Sat, 9 Sep 2023 08:21:17 +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 4RjQt51kt6z4JW7; Sat, 9 Sep 2023 08:21:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694247677; 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=DU9sJp7jyr5YEySMQlzhQRcAWiwMc2138P8zh7eM6Lw=; b=GVUMnWrjB73zudt1AeFoFr7va/d8PHT2hqiLlQ3G6Nz9AKpg+xkO1y+3tzvhtjjeR2REc8 KpZNCWsIHGiF8yjLYMvNtgiFhSa1KwVqw3cgqBz5XMldSFIeDWLN+XyANlLBKPB6BQl+p/ 2HRsAgtfUrbZ81d4oOt6d7SVhlK5qKD2UsPOyHtwyAH23iOb2W7Tv68fIX7JAMVrvBNfg+ IR8w83MT8FE/PsMI3pmJSU+O2sKAFnQCVEcyAa1bAp3cMHl67WQOu5SFlWn3PFfR/+doTt 49MiaulA7hAd4hHPB4PkfAUixbiS7b5dh9k8YShYEy6G0MYemBOTw6Zph/82Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694247677; a=rsa-sha256; cv=none; b=PkZ4bSmyg21Riy18C8DeKtxW98y4MiKHuKF5KyhHWWnLscY+CYm3msxOq3xXQIPi9q8bOf FNUxXDU0dJrgC/LN8ddgAjDwJm6cHufb7WDUGOeqjVBNNUxYiN2v4NvYneoX5DH4MefSga NYcN1D0rF/7rRhVrdLsTkTuLGFqll9WKYZDw3oXa0LjdSopy0kS4Ito3BfXnFXl+drwKPY vP5zv8/bmsE230sgNCqmfJAaivbEhHSVU8a2ngxbIRxfHw0gLqHqVEgr4PQkk1ZlvzscZd nzkfaEijSamHpDcRmfD5EHHw6V6qhtSUPv/JlfAezEBq2v18T6embVbh+4QR6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694247677; 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=DU9sJp7jyr5YEySMQlzhQRcAWiwMc2138P8zh7eM6Lw=; b=FBRurl0dbcYdKuWXpgB8RKSkDMX+aIT5/k2lCLum7Jazd655lcPtMu2WYRjZ6veqTg2g85 6wLh5KSK/CMaY1Ei3TxOqsDZuaSaMAABOnJZlR5XcI6C/NEt7/ljr0IzxnHhtigT7gIoXy BzPvpoChxQTDyaYtQP4og8UyTgvBY2JAE9Ak2BsDld2s00x+ZZus87iGX+9JaQwr7AMMUk XeZqgZAZq4Lf9fGPE/C6Q227GFiACIXDSaeKbmDn8gdMZp90hKjCyQNHcQI4pfS+YvUJIg GV0H/QY3qj6As4hE75NWSAd8oObWsq7Xtag0Jk285YgUMIAgEmPMM1ihAdvr2w== 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 4RjQt50HVBz36X; Sat, 9 Sep 2023 08:21:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3898LGEO046778; Sat, 9 Sep 2023 08:21:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3898LGVH046775; Sat, 9 Sep 2023 08:21:16 GMT (envelope-from git) Date: Sat, 9 Sep 2023 08:21:16 GMT Message-Id: <202309090821.3898LGVH046775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 205821a70ddd - main - kernel linker: Eliminate unneeded vnet propagation 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 205821a70dddfa106f6792e95693f411e8ce52d4 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=205821a70dddfa106f6792e95693f411e8ce52d4 commit 205821a70dddfa106f6792e95693f411e8ce52d4 Author: Zhenlei Huang AuthorDate: 2023-09-09 08:06:23 +0000 Commit: Zhenlei Huang CommitDate: 2023-09-09 08:06:24 +0000 kernel linker: Eliminate unneeded vnet propagation The module preload happens before vnet0 creation, at this moment the vnet list is empty thus invoking vnet_data_copy() during preload is a noop. With recent change 110113bc086f, for dynamic module load, aka via kldload, linker will do vnet propagation right after registering sysctls which happens after module load, then previous propagation (during module load) is redundant. No functional change intended. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39852 --- sys/kern/link_elf.c | 2 +- sys/kern/link_elf_obj.c | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 3e9998f27baa..568f1e1dbd95 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -724,6 +724,7 @@ parse_vnet(elf_file_t ef) ef->vnet_start = 0; ef->vnet_stop = 0; + ef->vnet_base = 0; error = link_elf_lookup_set(&ef->lf, "vnet", (void ***)&ef->vnet_start, (void ***)&ef->vnet_stop, NULL); /* Error just means there is no vnet data set to relocate. */ @@ -766,7 +767,6 @@ parse_vnet(elf_file_t ef) return (ENOSPC); } memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, size); - vnet_data_copy((void *)ef->vnet_base, size); elf_set_add(&set_vnet_list, ef->vnet_start, ef->vnet_stop, ef->vnet_base); diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 768808d2102e..d4ad963e8181 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -546,7 +546,6 @@ link_elf_link_preload(linker_class_t cls, const char *filename, } memcpy(vnet_data, ef->progtab[pb].addr, ef->progtab[pb].size); - vnet_data_copy(vnet_data, shdr[i].sh_size); ef->progtab[pb].addr = vnet_data; #endif } else if ((ef->progtab[pb].name != NULL && @@ -1113,18 +1112,11 @@ link_elf_load_file(linker_class_t cls, const char *filename, error = EINVAL; goto out; } - /* Initialize the per-cpu or vnet area. */ + /* Initialize the per-cpu area. */ if (ef->progtab[pb].addr != (void *)mapbase && !strcmp(ef->progtab[pb].name, DPCPU_SETNAME)) dpcpu_copy(ef->progtab[pb].addr, shdr[i].sh_size); -#ifdef VIMAGE - else if (ef->progtab[pb].addr != - (void *)mapbase && - !strcmp(ef->progtab[pb].name, VNET_SETNAME)) - vnet_data_copy(ef->progtab[pb].addr, - shdr[i].sh_size); -#endif } else bzero(ef->progtab[pb].addr, shdr[i].sh_size);