From nobody Wed Aug 28 00:40:24 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 4Wtltx0057z5MS6H; Wed, 28 Aug 2024 00:40:24 +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 4Wtltw6Vqjz47kL; Wed, 28 Aug 2024 00:40:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805624; 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=rzLf1HeWO2m+kWO26CIYQLHLp1oQSKkxD4AuPaj/lKs=; b=AbVYcgNN6veip3+iPRk3kzaIq7rRk3brd6Go6T+UxGR8gEdG77p41N6vOlKDgy9rbZr3Ph UCGrIBs61ZnPnT73JdgRoVeaK3uXT/ilq6tNGLcQ7j/igONLBTpjew6ftAd/XZJJQTMc0k mzz8OknntzChH/D3Dev42IxdMry8WLQ3bNEgLoaGhP271TTLslcC/Aom+uaAmg+zOGUCY4 hmfz2O1/jWx8bMEnAzpisaVnDikx6prPwXVa9EMARuK7AYqLBUfiF+KvrDnmhkg3v1DPnh E6mTQoCBb1Sw7fKIsKqH1jOt/FNsC7/tyYh+euAof4bd/paJOTTfXwPY8uxuWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805624; a=rsa-sha256; cv=none; b=eUnLCQHuuqqiH48eylFYGt0oSwNhMrEUWcac3wRHkJE4oXAQX6Z14BPW1GOJyakIlf6Lh9 p/g3y5/6XdI+EpmSCNW9j+QwYsXCY7ulAZepihXedcCtVH7DrOZcA8efOiMJU+QvOUIjqr b5uE5r2Q6p9fCOCwDYATC9+C/Fat6qSC6jvQdqKZCB6+rgSNMlX3lOEj/ev6YW37Ld5h79 vKeFWND4jnabRFL9WihH9frEq/mi+VTWzh4nuJUzBF8bSkH32epUeqDfXvzyTpxk4mlsiJ gXtIL/cVFcLq+PtLQlLYt8QhDqrD6UxMr1Ep7bJgeE5hOYSX2ktC/pHW89Ki2A== 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=1724805624; 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=rzLf1HeWO2m+kWO26CIYQLHLp1oQSKkxD4AuPaj/lKs=; b=GRmn+0NbKXqiS4Vf18aXjPOtSRIxNEnwMPku6iPf/jY+giqiB+mEl00I1POCd+f+x1vEyd GvKzY7lEF3VubHt0wRg6Kg5SywAfOB/ATYDN0HcPKdyqHGLWVWtGZe3tfXKXzdIutRxbmI dKWW8ErG/vLCyM/H0L0E+TRGpklCY9BPnBC5uEgAWBAmLJoXyY6gbBmZlHI4sZE2pfH3G5 KxkJ/h1TDNc2GmblPxE/ThmUWwbJEsDBWW2EKva9QUp6W6afNw+ICyYLn4yspLjmS49FKa MzvpHBdFqsJ1n9wcXnL44aH+ZAnIlraE31xCNyQpLTdXBL52X9sqQXK+h13M9Q== 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 4Wtltw66SGz1Bhh; Wed, 28 Aug 2024 00:40:24 +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 47S0eO14064628; Wed, 28 Aug 2024 00:40:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0eO4g064625; Wed, 28 Aug 2024 00:40:24 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:24 GMT Message-Id: <202408280040.47S0eO4g064625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c3cd4db461fd - stable/14 - amd64: add convenience wrappers for INVLPGB and TBLSYNC 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c3cd4db461fdb686b2aa3a199e7f1c8b89049208 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c3cd4db461fdb686b2aa3a199e7f1c8b89049208 commit c3cd4db461fdb686b2aa3a199e7f1c8b89049208 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:40:07 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: add convenience wrappers for INVLPGB and TBLSYNC (cherry picked from commit 111c7fc2fe21356a637f89fa58c407958f05ad93) --- sys/amd64/include/cpufunc.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 44d93494d830..b9893b8896d8 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -529,6 +529,29 @@ invpcid(struct invpcid_descr *d, int type) : : "r" (d), "r" ((u_long)type) : "memory"); } +#define INVLPGB_VA 0x0001 +#define INVLPGB_PCID 0x0002 +#define INVLPGB_ASID 0x0004 +#define INVLPGB_GLOB 0x0008 +#define INVLPGB_FIN 0x0010 +#define INVLPGB_NEST 0x0020 + +#define INVLPGB_DESCR(asid, pcid) (((pcid) << 16) | (asid)) + +#define INVLPGB_2M_CNT (1u << 31) + +static __inline void +invlpgb(uint64_t rax, uint32_t edx, uint32_t ecx) +{ + __asm __volatile("invlpgb" : : "a" (rax), "d" (edx), "c" (ecx)); +} + +static __inline void +tlbsync(void) +{ + __asm __volatile("tlbsync"); +} + static __inline u_short rfs(void) {