From nobody Fri Mar 25 16:49:46 2022 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 26A9C1A25261; Fri, 25 Mar 2022 16:49:47 +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 4KQ7Nq0XnDz3Plh; Fri, 25 Mar 2022 16:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648226987; 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=pLm2f0luO1IqzZxy6Qz3l1myf/AWhJooOkGrYuRpn44=; b=hYriYZce+lWtO4S72Fp0aaRout4NnZM7OJqrC01x1F+G6E/gz5w2Ha+Pw7N6JxINbGR7UM EjQpiUMgTbz3SQYsoXuHzUISvb/MWz3b6p7N1mk2mlu8zbaItn+oFa0x4hGH1ox2hH4t1s 721ghRAXr89hn9QNnAdN9H2VGvJowGrOW/l7KwKGnUG/QE9bAw6AWngGbbxQF9Ev7THAwh N3R2wuwGHFKX6lfw+vqIuiENeCNn68zrxBkKfuHOnmZJAYUK+yBwOVq9tbpKJR1fUzwqhz QY+xULfrv3xExXDK9vfYRdEhCZ0/CV1pNinv6yFhEr5bBAzudA8lMYKaH4pwWA== 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 E73001051B; Fri, 25 Mar 2022 16:49:46 +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 22PGnkgu075259; Fri, 25 Mar 2022 16:49:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22PGnkYf075258; Fri, 25 Mar 2022 16:49:46 GMT (envelope-from git) Date: Fri, 25 Mar 2022 16:49:46 GMT Message-Id: <202203251649.22PGnkYf075258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: D Scott Phillips Subject: git: a693a3003827 - main - arm64: pmap: Mask VA operand in TLBI instructions 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: scottph X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a693a30038278b1ccd3e67b98d76e259ca1b405d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648226987; 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=pLm2f0luO1IqzZxy6Qz3l1myf/AWhJooOkGrYuRpn44=; b=I6cOf4a7DLcSDRTd408WW++9olZTg+qJup53swTqZ/qa8OtsyUW0LsqLoFsjO9evk6YK/h aJw4qaEJ1UU9n5Wc/0iTRskXpVYmigDc6gGrBJCgfVUZKgAr1S0Mag2ra8ogVQHBu4htRK rTNtQYrnXvbLCHSk57LUCIrRN2MZMx6OmyLIBB39VD+pBxTz4aUXZkO6TuulqPS+6ABz8A BBuJPLO8okcUHbn+CS3QQ8QE6KrDgtSBI8W8R+STeua/OuDi4Dc4aCx5FpcHiInE8fiq83 MkSC9TSf+DhfSZMQNCNm4BSWq9zJybEhLjzFQOSC7HAWKldcAJsquqwIdfjVPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648226987; a=rsa-sha256; cv=none; b=U/sR9VilBFK1NZZ0mHrd63Sle9EJm/RypVz7WRWyORVL9J80SSxSzYHXKuPyA5LGRDVnKr 8xcEzT8UTt54er1/fSL4jPU7abYkGGt2QCv0tQxTIFjHwle2SyPTsbgcB55L4wsowcCujL 3XyZgiUz84pl8uelEieGzFonIT7YSpqRbVKJIwIuyl7neLkuDRhWhGjT+75sRb11VRFfYM f3aHItRItx5V/FgJb5RoCOLge3Xi3Vw7w6NugpnmXHOOiXmVbcdBpNqHfj2DZFb1ceAa/d a1WBVyoEGG+xePKXoQ83/7R/4FOu3EKr8HuOPIAB/nAkpYJO318zXrMDL8cLNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by scottph: URL: https://cgit.FreeBSD.org/src/commit/?id=a693a30038278b1ccd3e67b98d76e259ca1b405d commit a693a30038278b1ccd3e67b98d76e259ca1b405d Author: D Scott Phillips AuthorDate: 2022-03-25 16:04:11 +0000 Commit: D Scott Phillips CommitDate: 2022-03-25 16:49:33 +0000 arm64: pmap: Mask VA operand in TLBI instructions Bits 43:0 of the TLBI operand are bits 55:12 of the VA. Leaving bits 63:55 of the VA in bits 51:44 of the operand might wind up setting the TTL field (47:44) and accidentally restricting which translation levels are flushed in the TLB. Reviewed By: andrew MFC after: 3 days Sponsored by: Ampere Computing Differential Revision: https://reviews.freebsd.org/D34664 --- sys/arm64/arm64/pmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 0ab27e0a7b53..9776c36b3ef4 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -361,7 +361,8 @@ void (*pmap_invalidate_vpipt_icache)(void); #define COOKIE_TO_EPOCH(cookie) ((int)((u_long)(cookie) >> 32)) #define TLBI_VA_SHIFT 12 -#define TLBI_VA(addr) ((addr) >> TLBI_VA_SHIFT) +#define TLBI_VA_MASK ((1ul << 44) - 1) +#define TLBI_VA(addr) (((addr) >> TLBI_VA_SHIFT) & TLBI_VA_MASK) #define TLBI_VA_L3_INCR (L3_SIZE >> TLBI_VA_SHIFT) static int superpages_enabled = 1;