Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Mar 2021 19:20:11 GMT
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8b434feedfa9 - main - Only set delayed inval for procs using PTI
Message-ID:  <202103051920.125JKBMA084361@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by vangyzen:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b434feedfa9f71b59b9653c9335700abc019c03

commit 8b434feedfa9f71b59b9653c9335700abc019c03
Author:     Eric van Gyzen <vangyzen@FreeBSD.org>
AuthorDate: 2021-03-05 16:31:43 +0000
Commit:     Eric van Gyzen <vangyzen@FreeBSD.org>
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);
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103051920.125JKBMA084361>