From nobody Wed Nov 03 13:15:29 2021 X-Original-To: dev-commits-src-branches@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 1B3201833BF2; Wed, 3 Nov 2021 13:15:30 +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 4HknM603Zzz4cn7; Wed, 3 Nov 2021 13:15:30 +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 D5D7C1944F; Wed, 3 Nov 2021 13:15: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 1A3DFTMS055297; Wed, 3 Nov 2021 13:15:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A3DFTXe055296; Wed, 3 Nov 2021 13:15:29 GMT (envelope-from git) Date: Wed, 3 Nov 2021 13:15:29 GMT Message-Id: <202111031315.1A3DFTXe055296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 380736a95d3d - stable/13 - amd64 pmap: Pre-set PG_M on 2MB KASAN shadow map entries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 380736a95d3d6d5bec929936b08a0d998a660e39 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=380736a95d3d6d5bec929936b08a0d998a660e39 commit 380736a95d3d6d5bec929936b08a0d998a660e39 Author: Mark Johnston AuthorDate: 2021-08-10 20:23:42 +0000 Commit: Mark Johnston CommitDate: 2021-11-02 22:17:58 +0000 amd64 pmap: Pre-set PG_M on 2MB KASAN shadow map entries Also remove a redundant assertion in pmap_kasan_enter(). Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 4fd450a87df015fe85cadfac0e22c73e3c878d24) --- sys/amd64/amd64/pmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 62bc1bb22e96..a1f3a5cdc650 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -11340,7 +11340,7 @@ pmap_kasan_enter(vm_offset_t va) m = pmap_kasan_enter_alloc_2m(); if (m != NULL) { *pde = (pd_entry_t)(VM_PAGE_TO_PHYS(m) | X86_PG_RW | - X86_PG_PS | X86_PG_V | pg_nx); + X86_PG_PS | X86_PG_V | X86_PG_A | X86_PG_M | pg_nx); } else { m = pmap_kasan_enter_alloc_4k(); *pde = (pd_entry_t)(VM_PAGE_TO_PHYS(m) | X86_PG_RW | @@ -11352,8 +11352,6 @@ pmap_kasan_enter(vm_offset_t va) pte = pmap_pde_to_pte(pde, va); if ((*pte & X86_PG_V) != 0) return; - KASSERT((*pte & X86_PG_V) == 0, - ("%s: shadow address %#lx is already mapped", __func__, va)); m = pmap_kasan_enter_alloc_4k(); *pte = (pt_entry_t)(VM_PAGE_TO_PHYS(m) | X86_PG_RW | X86_PG_V | X86_PG_M | X86_PG_A | pg_nx);