From nobody Mon Oct 25 12:47:45 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 D55131805001; Mon, 25 Oct 2021 12:47:45 +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 4HdF9F54ddz3CKR; Mon, 25 Oct 2021 12:47:45 +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 8E977F85; Mon, 25 Oct 2021 12:47:45 +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 19PCljUS007304; Mon, 25 Oct 2021 12:47:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19PCljwK007303; Mon, 25 Oct 2021 12:47:45 GMT (envelope-from git) Date: Mon, 25 Oct 2021 12:47:45 GMT Message-Id: <202110251247.19PCljwK007303@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: 66e63d0cad4d - stable/13 - amd64: Zero the PML5 PTI page when initializing a pmap 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: 66e63d0cad4d92cca747a2f62517ca34a126bef2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=66e63d0cad4d92cca747a2f62517ca34a126bef2 commit 66e63d0cad4d92cca747a2f62517ca34a126bef2 Author: Mark Johnston AuthorDate: 2021-10-18 13:29:20 +0000 Commit: Mark Johnston CommitDate: 2021-10-25 12:46:43 +0000 amd64: Zero the PML5 PTI page when initializing a pmap The root page is not zeroed at allocation time since with 4-level tables each entry is copied from a template. However, with 5-level tables only a single entry is filled, so the rest need to be cleared. Reported by: alc Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit b0423d0f5eec89bd6c11c32649603031e3dbbfe1) --- sys/amd64/amd64/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 83f2a4c88bf7..43ed0f7b7411 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4186,6 +4186,7 @@ pmap_pinit_pml5_pti(vm_page_t pml5pgu) pml5_entry_t *pm_pml5u; pm_pml5u = (pml5_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml5pgu)); + pagezero(pm_pml5u); /* * Add pml5 entry at top of KVA pointing to existing pml4 pti