From nobody Thu May 04 15:40:13 2023 X-Original-To: dev-commits-src-main@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 4QBygf15xCz49DbK; Thu, 4 May 2023 15:40:14 +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 4QBygf0CWhz3QbN; Thu, 4 May 2023 15:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683214814; 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=ETpyl8RyUHLbUY4aRoaa7FQlTylfQoWxObnFQAFxgvg=; b=X0zYxbzJUf3sQsBOWRNJC8vMeQo60clzoYPkI/dn64oZV/2CmtrProQ4HqMCJeQxWYpoG8 0b0yzHZXfbPBMj6JdkqMQm5sjSp4dTp9yKTCmz3r/dq61hxEyI+LOg+UeDyx/MWk2riDy3 kojfR7h+b+ngoWG1xwlTq5GV/JlywB5ypwBW0LS3nLfdn2Assy1nBmRsEaQChk5CNVTYPB rwo1TrbvOnj+8B/hzChqx5yjpth1od68sWS3zV3aJO6yqBmspGl31xw1JYXVAoi33+j1Vs qu0jrBpqQt77kEGFwPjhp2zmgInHQmHvWtnyQfpRtB5QQuRNwYZ+WRI/zD7L6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683214814; 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=ETpyl8RyUHLbUY4aRoaa7FQlTylfQoWxObnFQAFxgvg=; b=l9IXu5gxRSaqPepiX28mNBn37eZZc1TIBlLU1j44YenJv2zTUH8P+jvgopNIi5+2AguHjI +vonAwu/HVJ2KvGeGo1fsLLlybmndVqqWSP6KcK35bN7O7mNp8KvpGLxIBp4riPCDWyHgE QCfdrUmguKgO1DvDd7vWCD4FiZHrFAXCqUi1IqquZdLRdwv46i5WoTMEjwxGUjux13mZFI CwOwNmQYwLD3TrXJ6affZ5IDK7O8nlbHD2JS5BGMbtTAJD7pLyqNjMc2I0ji3srJaTbMOr J7uWeuJ2/DghhN4Nfcc+v9B836J3CD2wHVT3cL+V05fzqQLx/asjlI7Gi0Qvng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683214814; a=rsa-sha256; cv=none; b=t+N5dbS7uAu5tVMEwm2nFW45bmoJjQNC5xSBrRxWNA1rSnwCi1n36eCNXyTGi5egs0YhvU tqecyA7qf+EVOkgsZ01rlggeR2brHenX1ypicD4i4Y8tjKXa01yjXhsax8eMF/JGYzPJhG thLPzzLpSQcrpW3TC8ucPiawTadoRSvQ0buCwVAZakXqYi7XSLg7HjPKHcnrpyy8GxG4X2 kM9OLrbgSYfn6fXi0x6bh3JlH+EaYd86Ecxsf8xqWLWux0FCwLGxz+oiO5qCMpwVC8+hmi //5XTPC10ZuOvryGkxbBSGT1WvOjq86BQOYW7WKQu//59lwYddhERFSZbkz+9w== 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 4QBygd6NC6zHch; Thu, 4 May 2023 15:40:13 +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 344FeD9C059260; Thu, 4 May 2023 15:40:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 344FeDEj059249; Thu, 4 May 2023 15:40:13 GMT (envelope-from git) Date: Thu, 4 May 2023 15:40:13 GMT Message-Id: <202305041540.344FeDEj059249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e704f88f3d92 - main - amd64: initialize APs kpmap_store in init_secondary() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e704f88f3d924202e60e37c82dd50a5022c89dd4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e704f88f3d924202e60e37c82dd50a5022c89dd4 commit e704f88f3d924202e60e37c82dd50a5022c89dd4 Author: Konstantin Belousov AuthorDate: 2023-05-04 06:17:30 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-04 15:39:22 +0000 amd64: initialize APs kpmap_store in init_secondary() The APs pcpu area is zeroed in init_secondary() by pcpu_init(), so the early initialization in pmap_bootstrap() is nop. Fixes: 42f722e721cd010ae5759a4b0d3b7b93c2b9cad2ESC Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D39945 --- sys/amd64/amd64/mp_machdep.c | 2 ++ sys/amd64/amd64/pmap.c | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 94589f736637..f6c3446e9981 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -215,6 +215,8 @@ init_secondary(void) /* See comment in pmap_bootstrap(). */ pc->pc_pcid_next = PMAP_PCID_KERN + 2; pc->pc_pcid_gen = 1; + pc->pc_kpmap_store.pm_pcid = PMAP_PCID_KERN; + pc->pc_kpmap_store.pm_gen = 1; pc->pc_smp_tlb_gen = 1; diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index a09920d62961..55086125fbb9 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2036,13 +2036,9 @@ pmap_bootstrap(vm_paddr_t *firstaddr) if (pmap_pcid_enabled) { kernel_pmap->pm_pcidp = (void *)(uintptr_t) offsetof(struct pcpu, pc_kpmap_store); - for (i = 0; i < MAXCPU; i++) { - struct pmap_pcid *pcidp; - pcidp = zpcpu_get_cpu(kernel_pmap->pm_pcidp, i); - pcidp->pm_pcid = PMAP_PCID_KERN; - pcidp->pm_gen = 1; - } + PCPU_SET(kpmap_store.pm_pcid, PMAP_PCID_KERN); + PCPU_SET(kpmap_store.pm_gen, 1); /* * PMAP_PCID_KERN + 1 is used for initialization of