From nobody Mon Nov 25 12:20:10 2024 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 4XxlCH1Rmpz5dWN5; Mon, 25 Nov 2024 12:20:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XxlCG6Q3nz4v1x; Mon, 25 Nov 2024 12:20:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732537210; 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=mKzSu3gjvYFbTAXdv73m7voZwRa3jBchr92tAZZjr6s=; b=Y0/hIg5z7n0jB0x5lzUwXKg/c7sVAJEtT+RKf28D3SntHcDwF/LeSBobg5v2ePsBTVR2hV NOSHm96e4MqwSEP0jAkH0T99Z0vaVn+y8gRhVm8T6P/6jXwil3Yl5/GWpDyzLCJofucawh lEtIZ95PP8IfEQkRmqGejMdx0l3Zjv4O5P+uETte4Y5FceCvGc7FXkhuRDAeKFnDQltDHt G81m/kOo8N193XLRTU/IcwcOcmTKtVOAfXcBhEk1jJXK7YZPItzc2nJnL7hnPON7YRAxLV iyJiGiRpCu723agPsn8GWN5seGcwysOnk1DT07IHVyH8QUwJ+IJmzZwapldC1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732537210; 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=mKzSu3gjvYFbTAXdv73m7voZwRa3jBchr92tAZZjr6s=; b=iMuRVLY+BVqiyKDjJCNAKr1wODwYQYse6hd4jTZ1Gy+94WbsCV86cOiw0+F+Y3CgUoOnxo Xsgmd+31HPTCcFxj+RXh5/X7Ue7NrP8PD+Z9dt3nNlg4m/JPHQBWQpUvln1mu5h/sfC1dW yR0+eZOAwfWv7eGvcCsmBA49OvdyXCAKeJZgK3XchHsTXBkBBn3KwgYlW2Pi1/rDinQP1E 7HKuTPV++yQ5F9ScTjX8evtQug96jlMGxRsTueShglc0Ibcubxj02G56dHrJmaKzN/tgf1 a/f3ATc5FmtGwG7aPTBE36B9HLCzT1gxA0W7b7AYIsmd5btzdY6W4veP6OBvfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732537210; a=rsa-sha256; cv=none; b=iNHLygzqu3T6AegKlzRgPSrjZ3KwpSZgyvzdnb9URojvc3LDm1HFURg/Y2zIjAt1Ldo/gZ qw5wJ/CFqCu0yrwrEXp3Q2UmYnWSdAJ37+mRLVl1G4YemG0EFBYkxMeonI77BSivcQk+wl LZgQG/93dv5MvR5a0xJV3bcLq/7rovaRl01ZLPX/xiTOITu76wZ8jUGaDL+BVlUz1F1Pyf HSR3PSz4LqzvshXZU1zLMHNriR5/zDU/LMFf/JO4dZDk6U+c3wSjuOWV2Mbr+Qjr0l+Rsz m2tTGI3HM8h95+gX2BrIQwwXclN4WYGmiZsnhzKYPhdUQckSUPPKx+7K2uTgxw== 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 4XxlCG5vNtzg9f; Mon, 25 Nov 2024 12:20:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4APCKA5h025820; Mon, 25 Nov 2024 12:20:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4APCKABF025806; Mon, 25 Nov 2024 12:20:10 GMT (envelope-from git) Date: Mon, 25 Nov 2024 12:20:10 GMT Message-Id: <202411251220.4APCKABF025806@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: 6ec4ff70885d - main - amd64: switch pmap_map_io_transient() to use pmap_kenter_attr() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 6ec4ff70885d8048be8de9b9d690dd371e3d4a3e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6ec4ff70885d8048be8de9b9d690dd371e3d4a3e commit 6ec4ff70885d8048be8de9b9d690dd371e3d4a3e Author: Konstantin Belousov AuthorDate: 2024-11-23 21:03:40 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-25 12:16:50 +0000 amd64: switch pmap_map_io_transient() to use pmap_kenter_attr() instead of constructing transient pte itself. This pre-set PG_A and PG_M bits, avoiding atomic pte update on access and modification. Also it set the nx bit, the mapping is not supposed to be used for executing. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47717 --- sys/amd64/amd64/pmap.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 21b8555b5380..82110e61d54a 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -10518,8 +10518,7 @@ pmap_map_io_transient(vm_page_t page[], vm_offset_t vaddr[], int count, { vm_paddr_t paddr; bool needs_mapping; - pt_entry_t *pte; - int cache_bits, error __unused, i; + int error __unused, i; /* * Allocate any KVA space that we need, this is done in a separate @@ -10564,11 +10563,8 @@ pmap_map_io_transient(vm_page_t page[], vm_offset_t vaddr[], int count, */ pmap_qenter(vaddr[i], &page[i], 1); } else { - pte = vtopte(vaddr[i]); - cache_bits = pmap_cache_bits(kernel_pmap, - page[i]->md.pat_mode, false); - pte_store(pte, paddr | X86_PG_RW | X86_PG_V | - cache_bits); + pmap_kenter_attr(vaddr[i], paddr, + page[i]->md.pat_mode); pmap_invlpg(kernel_pmap, vaddr[i]); } }