Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B8E5C2BD09 for ; Tue, 9 Jul 2024 16:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=njm4uZ0Lw9BFyxtWiwxVF3VN5uR1wZw8+jGDHNRLM0A=; b=N9YDkuFUJa/uyluIDcS/L8Jw50 KTHNeWCMMCsywLDO6jzroE20eRqZ86LAFPEmwzqlN/9E4gUVFJ9yfklnvbigr86wIBj1nRQvkZWbu ivO9qFuUyYZ2QMdlMmzjg6sLm0+GUZkL9+SbAJvQEBSPor9b/Z0/1nwDqU0xT6vx5wqltZ1EqspUh hdBRk1wyu2diwmWdevRs7qlFJGDtksH77152o3kmHQwAFeoTI1QNZ5kkhbqG1fNgWuC6CG/yGk+fe fLi75RUgRKsu4/XmouGslEr3BjwZzPv2G/4/Bvx9q4wrVFBUWIG+9ManJGQyxIj/+NVVfAZSquybH 9SlpB9Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRDQR-00000007s7O-3XgI; Tue, 09 Jul 2024 16:10:43 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRDQA-00000007s0u-1YGC for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 16:10:27 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C97836140F; Tue, 9 Jul 2024 16:10:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76BF5C3277B; Tue, 9 Jul 2024 16:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1720541425; bh=dEKyruLdPH2pDX0kmbXmCiklGz1ydmteLSmu2zeYaz4=; h=From:To:Cc:Subject:Date:From; b=lFwYtHV8ukNEJCi2d7VumgMFsrKiqEN6tG8QhI3hNXwhdXAQp7E0leXdRmedso8yD U6b93Btc5kSXIXHeJwjb/KQddWya/7TdCb3HGd6KZu003K8NWVNnLx0kgVavkF/fRT c4eFsUUqq7Mqqzd5/ip/xLkbzmO8dizDOAncTUHU= From: Linus Torvalds To: Mark Rutland Cc: Linux ARM Subject: arm64 uaccess series Date: Tue, 9 Jul 2024 09:01:58 -0700 Message-ID: <20240709161022.1035500-1-torvalds@linux-foundation.org> X-Mailer: git-send-email 2.45.1.209.gc6f12300df MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240709_091026_467832_A5DF985F X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is also available at git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git arm64-uaccess and is three patches, although I expect that I'll only merge the first two in the 6.11 merge window because that final one is still a bit special. I've been running variations of this on my Altra machine for the last month or more, but admittedly my loads are trivial and uninteresting (ie mostly kernel builds). So my test coevrage is not very wide. I like the bit 55 checks in that access_ok() rewrite - and they are actually simpler than worrying about 64-bit overflow - but they are also admittedly quite different from what the code does elsewhere, and there's the whole discussion about how the top byte ignore should really work. NOTE: This does *not* contain the "user address masking" part. I've only written the x86-64 version of that, and while it touches similar areas, it's pretty orthogonal to this part which is about the regular low-level accesses. Linus arm64: start using 'asm goto' for get_user() when available arm64: start using 'asm goto' for put_user() arm64: access_ok() optimization arch/arm64/Kconfig | 1 + arch/arm64/include/asm/asm-extable.h | 3 + arch/arm64/include/asm/uaccess.h | 192 ++++++++++++++++++++++++----------- arch/arm64/kernel/mte.c | 12 +-- 4 files changed, 142 insertions(+), 66 deletions(-)