From nobody Tue May 02 11:39:50 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 4Q9dRC1kKqz48tJQ; Tue, 2 May 2023 11:39:51 +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 4Q9dRC0sp0z3qBf; Tue, 2 May 2023 11:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683027591; 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=jOBAnurKyn7R3b4vwVGxF+WNhhOTA26RHhBT6Gqh/YU=; b=AkdlIAWFps/IFv7RIjpM5j24lt2eYwZfytqPdbvFgjvUgZNmLQD342LsNqSUDnkb1UrUw6 k/pTGUI1miGHK9EhGu+IiKFSg+Z075ugb/7M27FPe4NvpMPmHrbzS7WhtCzGPKylXzQOcF uQPNtuFDml1SeTaaQCz2O4fkK6OASKNqYJ+VlLOCLjrNrxdncJtfBxCtjtSmcfDKtUewOt +dLq3bQbyqIXYA4JC9Cw1cXO01YmxO30VF80PIkoqaAkxT9+aTgahchhNim8q+GjfLDX3z BZh3GBto6P7A2MdH0GUQxIDIFhyGz+Gkrr2ceKSDXz1fI3HyE+hZpFUVJR5lpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683027591; 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=jOBAnurKyn7R3b4vwVGxF+WNhhOTA26RHhBT6Gqh/YU=; b=nuS3JimfGyTc+9g4NzWOkT9KfVGMGepIFi8R7r8qo283U46yoasSMrc9+/tVTH0A3bTxYH iVbt59iIQNOddd6NYMxGWChaM4khRgKyUNLlK/2UojF0+AQ3kcGAFIa2AYvtl1M3+rLWTD kqV+9cQznC3fMV2rcQRwgwkzG33//jZMe/8/ngLnuaI+m/zDt6mdt/KxEBha0M0UsIHF/v yLcCkH8pDrp8Q56U7wlrjFz+cWTXbhE4bLgFLPnD/2Fec213VK4Uw0FceNZV3bj2b6A5nw 25NwNmb4fcKZnaQc81Jd6YHWYHootMpwqhTIowZFRtb5UQRFYzfBjBWE0nfxbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683027591; a=rsa-sha256; cv=none; b=Qa3CkD36MQfA8yuL0ZTvnWo5h8ZlxAXw0B5PfgYqdX/QhR0eXPRdRLBcAOZ9v4dXnA02Tj XP3F4Aui+0CfoYy7KJggn5PmmI3/K+z1mtWcq51B9oM7fR55UvESIjlGjKFjMCMhQqDU7S X4a6pIcDrwUuJFlJwFwQa7WBVs0FJNVkfgob/SGYmMVK4c3SnQqO6ghdpfWFqrYIwG2Gi9 YeBd2D/Clma9hE1niZtPGs5n6xHgiPn8439/pRK/owWUdM5yx0QOa35+yOkIyhZQbRRgP7 HeKRIK+G+0VhaUrXYBpplC3V0XPRBLo2E34nfRPAoq+MtL2ddxz01I8eE212nA== 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 4Q9dRB72thzm4n; Tue, 2 May 2023 11:39:50 +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 342Bdod7092284; Tue, 2 May 2023 11:39:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342BdoTQ092283; Tue, 2 May 2023 11:39:50 GMT (envelope-from git) Date: Tue, 2 May 2023 11:39:50 GMT Message-Id: <202305021139.342BdoTQ092283@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: 32bb28d8ad31 - main - amd64: move definition of the struct pmap_pcids into _pmap.h 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32bb28d8ad31294579bd95c29e84a5985e543ae5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=32bb28d8ad31294579bd95c29e84a5985e543ae5 commit 32bb28d8ad31294579bd95c29e84a5985e543ae5 Author: Konstantin Belousov AuthorDate: 2023-05-01 11:06:30 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-02 11:32:20 +0000 amd64: move definition of the struct pmap_pcids into _pmap.h and rename the structure to pmap_pcid. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D39890 --- sys/amd64/amd64/pmap.c | 2 ++ sys/amd64/include/_pmap.h | 39 +++++++++++++++++++++++++++++++++++++++ sys/amd64/include/pmap.h | 8 ++------ 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index e8a88aab3225..92d9a66837cd 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4362,6 +4362,8 @@ pmap_free_pt_page(pmap_t pmap, vm_page_t m, bool zerofilled) pmap_pt_page_count_adj(pmap, -1); } +_Static_assert(sizeof(struct pmap_pcid) == 8, "Fix pcpu zone for pm_pcidp"); + /* * Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. diff --git a/sys/amd64/include/_pmap.h b/sys/amd64/include/_pmap.h new file mode 100644 index 000000000000..b4b1b5962838 --- /dev/null +++ b/sys/amd64/include/_pmap.h @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2014-2020 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by + * Konstantin Belousov under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _MACHINE__PMAP_H_ +#define _MACHINE__PMAP_H_ + +struct pmap_pcid { + uint32_t pm_pcid; + uint32_t pm_gen; +}; + +#endif diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index d74f25cc8024..3b99b88742e5 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -291,6 +291,7 @@ #include #include #include +#include #include #include #include @@ -371,11 +372,6 @@ enum pmap_type { PT_RVI, /* AMD's nested page tables */ }; -struct pmap_pcids { - uint32_t pm_pcid; - uint32_t pm_gen; -}; - /* * The kernel virtual address (KVA) of the level 4 page table page is always * within the direct map (DMAP) region. @@ -394,7 +390,7 @@ struct pmap { long pm_eptgen; /* EPT pmap generation id */ smr_t pm_eptsmr; int pm_flags; - struct pmap_pcids pm_pcids[MAXCPU]; + struct pmap_pcid pm_pcids[MAXCPU]; struct rangeset pm_pkru; };