From nobody Tue Aug 23 20:31:29 2022 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 4MC18x6tGSz4ZD0p; Tue, 23 Aug 2022 20:31:29 +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 4MC18x6Sjzz3Y23; Tue, 23 Aug 2022 20:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661286689; 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=WcmED6eGmojNkHCsfhwX/CdbirT7JyTpb7uywq90hxU=; b=L9dq+u0mRkfrYsOxnd94/dR5S75T9rUTPLLOhph4rOsleqw1y9NTHram9etSn9uv4YfWkS VNWrzAsfKV3V+qmHeBSSQhz5JUOVOKKieA+YivwYXRyDaUuJPi4TC83ZPkf8Othzdh6lUu RFJWU2waCefQXF8geV91YxJSkk0ezhOb42Y4uabJUTJSbXWvfGA2LG2/i+tL+yF4i0iLvg YOvNxhUNhQ6MkAut9nDNu0qRQhZHpC0EeV8UqpoXBgTej/UPlNXPsjRluxoi+I9sC/RiLI jvydNZFjmCTSArgefm/lvZqOb8PwdoIsRX+YJxMkKDF1/0vGDpbIq5p9d+2ISA== 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 4MC18x5XH2zjkV; Tue, 23 Aug 2022 20:31:29 +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 27NKVTjY033896; Tue, 23 Aug 2022 20:31:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27NKVT2H033895; Tue, 23 Aug 2022 20:31:29 GMT (envelope-from git) Date: Tue, 23 Aug 2022 20:31:29 GMT Message-Id: <202208232031.27NKVT2H033895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e66390736613 - main - Define _NPCM and the last PC_FREEn constant in terms of _NPCPV. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e66390736613a452238531f64bb9f674ebd4c3a6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661286689; 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=WcmED6eGmojNkHCsfhwX/CdbirT7JyTpb7uywq90hxU=; b=QOJUQVqTtnYpaUSveQR1UGebl9u9FPPax/rDPqjOJgF28wMzAWk3EqYJz1c5g3Xeobn91A dq+UH/+OilNpftRhJnZmk0LNqtclESQ5QDqB9ceWq6jLRWGfln1aEf3vNbB+GxF9yFxjO9 +Xdj0nzU8HQpSfWLrp/GnxmHMIywh1TtDw2PiGg40AVdxYp0dvXqAYOE+OW7UfeZJ0K29Y zNSjypgPllcPEKuTmWPFLXqKSeloLidBVWs0LHhfbpDeZ3qWtgs0SbH5bA6wGixyKUFPw1 eycVBWhFtdSjAJCoNYM5ki5O1m8DqyJOtvzKNPYejQG5bLcj2p3Fw/6w8V1WJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661286689; a=rsa-sha256; cv=none; b=jTvmjv95gjdfHQYKcgS8yF/95O6nYDc8DJNaSW3glXd7jz6sdQENjM3PICzEvETFq5wCgg e4EQdnqksxofKf2s6rwe7+V1sEd03BOC8av4scC7mKhpvxsLQKLgp2oepK4mNbWFMo1uwL DIOeLf7nQRR6acHLjIR6GkzGBmisa8gbsBzhIG/jLPiuvzX9XnaXdElbIeOvC8huWsOgA0 sA+jJJXmbjV6W9jmzYiRlCWq2AY/qCkQjz66BnsslY1U4bPmOVCumrhwm99yzCxyIRS+H/ wqhZ5nApAM3y7RQHikRkiL/gLsbkEFDwfpszJUmsMLc724Fbz1P3BuuCElyEuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e66390736613a452238531f64bb9f674ebd4c3a6 commit e66390736613a452238531f64bb9f674ebd4c3a6 Author: John Baldwin AuthorDate: 2022-08-23 20:31:02 +0000 Commit: John Baldwin CommitDate: 2022-08-23 20:31:02 +0000 Define _NPCM and the last PC_FREEn constant in terms of _NPCPV. This applies one of the changes from 5567d6b4419b02a2099527228b1a51cc55a5b47d to other architectures besides arm64. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36263 --- sys/amd64/amd64/pmap.c | 2 +- sys/amd64/include/pmap.h | 3 ++- sys/arm/arm/pmap-v6.c | 2 +- sys/arm/include/pmap-v6.h | 3 ++- sys/i386/i386/pmap.c | 2 +- sys/i386/include/pmap.h | 3 ++- sys/powerpc/aim/mmu_radix.c | 2 +- sys/powerpc/include/pmap.h | 3 ++- sys/riscv/include/pmap.h | 3 ++- sys/riscv/riscv/pmap.c | 2 +- 10 files changed, 15 insertions(+), 10 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 893774357629..326103a1affb 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -5085,7 +5085,7 @@ pv_to_chunk(pv_entry_t pv) #define PC_FREE0 0xfffffffffffffffful #define PC_FREE1 0xfffffffffffffffful -#define PC_FREE2 0x000000fffffffffful +#define PC_FREE2 ((1ul << (_NPCPV % 64)) - 1) static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 }; diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 3d51803d82b7..c37ae82c0301 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -439,8 +439,9 @@ typedef struct pv_entry { * pv_entries are allocated in chunks per-process. This avoids the * need to track per-pmap assignments. */ -#define _NPCM 3 #define _NPCPV 168 +#define _NPCM howmany(_NPCPV, 64) + #define PV_CHUNK_HEADER \ pmap_t pc_pmap; \ TAILQ_ENTRY(pv_chunk) pc_list; \ diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 51438274f1ff..107519be9dc0 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -2753,7 +2753,7 @@ pv_to_chunk(pv_entry_t pv) #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap) #define PC_FREE0_9 0xfffffffful /* Free values for index 0 through 9 */ -#define PC_FREE10 0x0000fffful /* Free values for index 10 */ +#define PC_FREE10 ((1ul << (_NPCPV % 32)) - 1) /* Free values for index 10 */ static const uint32_t pc_freemask[_NPCM] = { PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, diff --git a/sys/arm/include/pmap-v6.h b/sys/arm/include/pmap-v6.h index aa596aa699c6..adb21fbb82fa 100644 --- a/sys/arm/include/pmap-v6.h +++ b/sys/arm/include/pmap-v6.h @@ -143,8 +143,9 @@ typedef struct pv_entry { * pv_entries are allocated in chunks per-process. This avoids the * need to track per-pmap assignments. */ -#define _NPCM 11 #define _NPCPV 336 +#define _NPCM howmany(_NPCPV, 32) + struct pv_chunk { pmap_t pc_pmap; TAILQ_ENTRY(pv_chunk) pc_list; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index eaff33bafe84..70139b2f4e66 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -2301,7 +2301,7 @@ pv_to_chunk(pv_entry_t pv) #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap) #define PC_FREE0_9 0xfffffffful /* Free values for index 0 through 9 */ -#define PC_FREE10 0x0000fffful /* Free values for index 10 */ +#define PC_FREE10 ((1ul << (_NPCPV % 32)) - 1) /* Free values for index 10 */ static const uint32_t pc_freemask[_NPCM] = { PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 5ac99b92cad3..7174c3d5b2bd 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -209,8 +209,9 @@ typedef struct pv_entry { * pv_entries are allocated in chunks per-process. This avoids the * need to track per-pmap assignments. */ -#define _NPCM 11 #define _NPCPV 336 +#define _NPCM howmany(_NPCPV, 32) + struct pv_chunk { pmap_t pc_pmap; TAILQ_ENTRY(pv_chunk) pc_list; diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 955618d57e68..82d411db851a 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -1169,7 +1169,7 @@ pv_to_chunk(pv_entry_t pv) #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap) #define PC_FREE0 0xfffffffffffffffful -#define PC_FREE1 0x3ffffffffffffffful +#define PC_FREE1 ((1ul << (_NPCPV % 64)) - 1) static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1 }; diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h index d14398750080..1240b5fe5c7e 100644 --- a/sys/powerpc/include/pmap.h +++ b/sys/powerpc/include/pmap.h @@ -214,8 +214,9 @@ struct pmap { * pv_entries are allocated in chunks per-process. This avoids the * need to track per-pmap assignments. */ -#define _NPCM 2 #define _NPCPV 126 +#define _NPCM howmany(_NPCPV, 64) + #define PV_CHUNK_HEADER \ pmap_t pc_pmap; \ TAILQ_ENTRY(pv_chunk) pc_list; \ diff --git a/sys/riscv/include/pmap.h b/sys/riscv/include/pmap.h index 8eb5b394fd32..6bfede99e578 100644 --- a/sys/riscv/include/pmap.h +++ b/sys/riscv/include/pmap.h @@ -97,8 +97,9 @@ typedef struct pv_entry { * pv_entries are allocated in chunks per-process. This avoids the * need to track per-pmap assignments. */ -#define _NPCM 3 #define _NPCPV 168 +#define _NPCM howmany(_NPCPV, 64) + struct pv_chunk { struct pmap * pc_pmap; TAILQ_ENTRY(pv_chunk) pc_list; diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 9799b2b7bd91..3ac6f9997978 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1727,7 +1727,7 @@ pv_to_chunk(pv_entry_t pv) #define PC_FREE0 0xfffffffffffffffful #define PC_FREE1 0xfffffffffffffffful -#define PC_FREE2 0x000000fffffffffful +#define PC_FREE2 ((1ul << (_NPCPV % 64)) - 1) static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 };