From owner-dev-commits-src-all@freebsd.org Fri Mar 5 19:20:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D52A563EC4; Fri, 5 Mar 2021 19:20:12 +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 4Dscy415KGz3LDH; Fri, 5 Mar 2021 19:20:12 +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 143FE15CBD; Fri, 5 Mar 2021 19:20:12 +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 125JKBK4084364; Fri, 5 Mar 2021 19:20:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125JKBMA084361; Fri, 5 Mar 2021 19:20:11 GMT (envelope-from git) Date: Fri, 5 Mar 2021 19:20:11 GMT Message-Id: <202103051920.125JKBMA084361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 8b434feedfa9 - main - Only set delayed inval for procs using PTI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b434feedfa9f71b59b9653c9335700abc019c03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 19:20:12 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=8b434feedfa9f71b59b9653c9335700abc019c03 commit 8b434feedfa9f71b59b9653c9335700abc019c03 Author: Eric van Gyzen AuthorDate: 2021-03-05 16:31:43 +0000 Commit: Eric van Gyzen CommitDate: 2021-03-05 19:20:08 +0000 Only set delayed inval for procs using PTI invltlb_invpcid_pti_handler() was requesting delayed TLB invalidation even for processes that aren't using PTI. With an out-of-tree change to avoid PTI for non-jailed root processes, this caused an assertion failure in pmap_activate_sw_pcid_pti() when context-switching between PTI and non-PTI processes. Reviewed by: bdrewery kib tychon Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D29094 --- sys/amd64/amd64/mp_machdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index aa62c2086fa4..11f2bb8bbfc1 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -851,7 +851,8 @@ invltlb_invpcid_pti_handler(pmap_t smp_tlb_pmap) invpcid(&d, INVPCID_CTXGLOB); } else { invpcid(&d, INVPCID_CTX); - if (smp_tlb_pmap == PCPU_GET(curpmap)) + if (smp_tlb_pmap == PCPU_GET(curpmap) && + smp_tlb_pmap->pm_ucr3 != PMAP_NO_CR3) PCPU_SET(ucr3_load_mask, ~CR3_PCID_SAVE); } }