From nobody Wed Aug 21 16:36: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 4WpsQy5DNQz5V8ST; Wed, 21 Aug 2024 16:36:10 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpsQy4jlfz4Y9y; Wed, 21 Aug 2024 16:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724258170; 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=Zw8WlpTLtH8xL3Xne8yeMQBP+fgc8Wxl3ITPm8edlG0=; b=rpFU8dXX8FLf2EebeXSwMMXhHzpAKuQsZoeMM2Ry7uo9ySI4UfBJgCmuGllRjBvw9PS/Lm 52ncXR5/OpMz3o8g++QZ4OneWuIvVhIJdKwk6Tp5QA8yy7qiSjxE9FaDFfWA68mYdeQTP2 7Z73JAFg9yGCaznZigpEvpKHudE9MFV3ZtgqQqUJeWeJ42/hqRyUXWw4VkYits5od3blrz yHvnC2m5S80O3/Lcw1nHgQnfdK/7lSloCLrDYCz6iXstu168FrgYH2gkvVYE0B1s9h4kgH Hrn1tu6aGqyo6GLWgztmPTH+Z7/lx//0e6E0BXcWI5Z+Ma5N6MtgAka0SnP64g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724258170; a=rsa-sha256; cv=none; b=ctSBGEvID7DYx812Y3ZENXdcZM3M92GzbTXt7oWik+GRQ7dUk1aNypXN/OkL0Jwn+maMXB iZowKeS9HMODuRVHapZAX8M8qsHNCeEhYB9G2uoQsTX3vVrfG+nq5w2rJJikJDhEWwUOl3 L3GO5AfbYBIysXc71mo2s1KrzMPQC+r1KzF3LxDlA27D3pp88fd19NJqS1Hs+ltfpeie1J 2YlnxqzDHcTkKbBcxgBM61d9nwzWBDgKJ+htEWJTzXzidfuATM11nEO38QmFdZYz3cAy79 In7zwe63y8SpT3kDhLYeVZYHkD0DdafevlTKleyGmPrkqbN5n8YlQ+jvomjxnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724258170; 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=Zw8WlpTLtH8xL3Xne8yeMQBP+fgc8Wxl3ITPm8edlG0=; b=bS2xa3+DTEot0VGSTWhpW3LCfIgK0HZfyTD7d+xk3hpoqzBwQjs/WP2NN81wUO5vBUzt/d jEp36mH3dMmyJCQ5aol6hEAmBbrnF51X+CXUnONsa45s9GZxv13gQN+kAyQOLbxKgOjWLq HoYqhRpKtINaNvgslhRUrR9ApglMdPntWTi4HHsFoNxedgmjwaUQVOvr+dCLDYXcU4jopl AUQhzm6y81rPwpXWI+KAapdIBLp8j5bxfJbf54iFbmE2lIq/bbAJH4Gws0sh5MtTD/nMAa S4ZWOU1nvZG9XJs5kZs90gIO6Tlgw4Wt6EbklWn33Sq9gKq5FRLjbtTvYRt9jQ== 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 4WpsQy4K9YzrgM; Wed, 21 Aug 2024 16:36: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 47LGaAK6089053; Wed, 21 Aug 2024 16:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LGaAMa089050; Wed, 21 Aug 2024 16:36:10 GMT (envelope-from git) Date: Wed, 21 Aug 2024 16:36:10 GMT Message-Id: <202408211636.47LGaAMa089050@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: bc4ffcadf268 - main - amd64: add variables indicating INVLPGB works 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: bc4ffcadf2681c954444e1853200dca3f5e65676 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc4ffcadf2681c954444e1853200dca3f5e65676 commit bc4ffcadf2681c954444e1853200dca3f5e65676 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:41:17 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 16:35:07 +0000 amd64: add variables indicating INVLPGB works Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45191 --- sys/amd64/amd64/machdep.c | 6 ++++++ sys/amd64/amd64/pmap.c | 4 ++++ sys/amd64/include/pmap.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index c509dcc2f7dd..025c3c365de5 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1487,6 +1487,12 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) finishidentcpu(); /* Final stage of CPU initialization */ + invlpgb_works = (amd_extended_feature_extensions & + AMDFEID_INVLPGB) != 0; + TUNABLE_INT_FETCH("vm.pmap.invlpgb_works", &invlpgb_works); + if (invlpgb_works) + invlpgb_maxcnt = cpu_procinfo3 & AMDID_INVLPGB_MAXCNT; + /* * Initialize the clock before the console so that console * initialization can use DELAY(). diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index cf0fc7184f56..ff5c229b7652 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -550,6 +550,10 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, int invpcid_works = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, "Is the invpcid instruction available ?"); +int invlpgb_works; +SYSCTL_INT(_vm_pmap, OID_AUTO, invlpgb_works, CTLFLAG_RD, &invlpgb_works, 0, + "Is the invlpgb instruction available?"); +int invlpgb_maxcnt; int pmap_pcid_invlpg_workaround = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_invlpg_workaround, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 273693e1f782..0819b3bc2945 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -424,6 +424,8 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dmaplimit; extern int pmap_pcid_enabled; extern int invpcid_works; +extern int invlpgb_works; +extern int invlpgb_maxcnt; extern int pmap_pcid_invlpg_workaround; extern int pmap_pcid_invlpg_workaround_uena;