From nobody Sat Jan 08 04:35:42 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 5F67919361F6; Sat, 8 Jan 2022 04:35:43 +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 4JW6ht4Qfmz3KY4; Sat, 8 Jan 2022 04:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 6D8B318673; Sat, 8 Jan 2022 04:35:42 +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 2084ZgFU036019; Sat, 8 Jan 2022 04:35:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2084ZgL7036018; Sat, 8 Jan 2022 04:35:42 GMT (envelope-from git) Date: Sat, 8 Jan 2022 04:35:42 GMT Message-Id: <202201080435.2084ZgL7036018@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: 15964f1cb393 - main - amd64 pmap: preset A and M bits for pmap_qenter() and pmap_kenter() mappings 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: 15964f1cb3935b612c833b863219fef0a3932edf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641616542; 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=5djMX3ym+P3V2akRSs0+Hq33D2nQcS5kwiUiXhrqD/E=; b=FPuG2eC2HOBj3y7dE9A8by3v7ZW/Zp1+m2ZX1mvAr/+aFmZNYvDESwiX2oDv2GxElY3RQX wn21hMR9ZlacXqUNBbJg1po0+Fxzd/TWYDMOIBs8+MPG4zCoCO5sAS8LbMr/3eFsiP4m3J ulc4PXxWiWH+GjsIgN5mglPYq4yN9deukd9lQvMDKSkhjHwConEMMvWY1f73z0K6GFpcMC ojOqN5fw2lsQ+5i2y0lSpRR7PDTML5pDHJlX6flddR/HYoQgZheEJK6Wz8tHtW+5HyUWz/ gzb5FtYximUonAlWQN0Ho3rugjTD6JSGdlK6g9n+VBVqjC/RiOw0OIISTZpPow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641616542; a=rsa-sha256; cv=none; b=dUVYYK6ERuOOo9JXYh7ERZLYJBeLP0jTrpPYqw6lFYCFyFdB2Wh+Z7ngurgB+dlPqfA0Z2 0BJcR5lS/5KbFCydIWJ/9rmlOhJsSZ1d401waTEDX0Ym/L9cyYrgW04yYjCxJrW9xobASX WMbH1wGZ5oiZ/uylRth1ygoy6SeCAn2tj5QEK3rs1OJQJpCvrcQHfTi88PbhrFr4fKsIMN j/UlyB4ArxaAGbyGwfAk6LUYtZRUaa0wzPYmhx4HP5Euw5cPtrIDlLUvzLsJSXJNe60M4V 7O+3JpZ8nSID03ONzcg7KupDUsi9itqJ/c0KDPygf/0SxbrP+utSiOfhRNrIrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=15964f1cb3935b612c833b863219fef0a3932edf commit 15964f1cb3935b612c833b863219fef0a3932edf Author: Konstantin Belousov AuthorDate: 2022-01-05 01:25:41 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-08 04:34:18 +0000 amd64 pmap: preset A and M bits for pmap_qenter() and pmap_kenter() mappings This removes one or two atomic update of the pte on access. Also it makes the pte constant during its lifecycle. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33778 --- sys/amd64/amd64/pmap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8b5d58c2a540..5f72ff3acf08 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -3897,7 +3897,8 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa) pt_entry_t *pte; pte = vtopte(va); - pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx); + pte_store(pte, pa | pg_g | pg_nx | X86_PG_A | X86_PG_M | + X86_PG_RW | X86_PG_V); } static __inline void @@ -3908,7 +3909,8 @@ pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode) pte = vtopte(va); cache_bits = pmap_cache_bits(kernel_pmap, mode, 0); - pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx | cache_bits); + pte_store(pte, pa | pg_g | pg_nx | X86_PG_A | X86_PG_M | + X86_PG_RW | X86_PG_V | cache_bits); } /* @@ -3967,7 +3969,8 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pa = VM_PAGE_TO_PHYS(m) | cache_bits; if ((*pte & (PG_FRAME | X86_PG_PTE_CACHE)) != pa) { oldpte |= *pte; - pte_store(pte, pa | pg_g | pg_nx | X86_PG_RW | X86_PG_V); + pte_store(pte, pa | pg_g | pg_nx | X86_PG_A | + X86_PG_M | X86_PG_RW | X86_PG_V); } pte++; }