From mboxrd@z Thu Jan 1 00:00:00 1970 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 1761FC83F1A for ; Mon, 21 Jul 2025 09:10:44 +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=al7LlD3c6tjLlaCBhgnMWsKuNeaY0E1Mj0hAvs2H5NY=; b=dNlC/lesu39vbz7Wo3GvUJ0077 0xfXlzIXpKFG2f10CY5vUbcVD9UErYN8MU5NPUaViSr8bTwkXCFEFZdSRJoYRofLmV5PgF/97iiDQ cBGK7mgDeilqP552RLQiGXyUUys1o/1DAUAxlRWpEi5P4KYb8N6AIMCaMjU9wlDnfnm6850cj02VQ EXhEpUTJJcBN3WNdQeLjkjr5Y57j5GTuW0IXj5cmTjBtfRIzPtgXN6+Ep5rLvI/q/AHKQwK1N+nh/ a4HWzPPB+m77A0ahjzl+SPYQ2IrYhnvviRYMOmhYMLE04dRyb6A2Pjfx+2NvCsfGNRS7q6eC20kG3 leU/+smg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1udmXe-0000000Gl6H-2rFu; Mon, 21 Jul 2025 09:10:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1udm0g-0000000GgBC-0fFX for linux-arm-kernel@lists.infradead.org; Mon, 21 Jul 2025 08:36:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09584153B; Mon, 21 Jul 2025 01:36:26 -0700 (PDT) Received: from e129823.cambridge.arm.com (e129823.arm.com [10.1.197.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 13B2D3F66E; Mon, 21 Jul 2025 01:36:29 -0700 (PDT) From: Yeoreum Yun To: catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org, oliver.upton@linux.dev, ardb@kernel.org, frederic@kernel.org, james.morse@arm.com, joey.gouly@arm.com, scott@os.amperecomputing.com, maz@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yeoreum Yun Subject: [PATCH v4 0/7] support FEAT_LSUI and apply it on futex atomic ops Date: Mon, 21 Jul 2025 09:36:11 +0100 Message-Id: <20250721083618.2743569-1-yeoreum.yun@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250721_013634_241394_8E1BC67A X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. 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 Since Armv9.6, FEAT_LSUI supplies the load/store instructions for previleged level to access to access user memory without clearing PSTATE.PAN bit. This patchset support FEAT_LUSI and applies in futex atomic operation where can replace from ldxr/stlxr pair implmentation with clearing PSTATE.PAN bit to correspondant load/store unprevileged atomic operation without clearing PSTATE.PAN bit. Patch Sequences ================ Patch #1 adds cpufeature for FEAT_LUSI Patch #2 expose FEAT_LUSI to guest Patch #3 adds Kconfig for FEAT_LUSI Patch #4 separtes former futex atomic-op implmentation from futex.h to futex_ll_sc_u.h Patch #5 implments futex atomic operation using lsui instruction. Patch #6 introduces lsui.h to apply runtime patch to use former implmentation when FEAT_LUSI doesn't support. Patch #7 applies lsui.h into arch_futext_atomic_op(). Patch History ============== from v3 to v4: - rebase to v6.16-rc7 - modify some patch's title. - https://lore.kernel.org/all/20250617183635.1266015-1-yeoreum.yun@arm.com/ from v2 to v3: - expose FEAT_LUSI to guest - add help section for LUSI Kconfig - https://lore.kernel.org/all/20250611151154.46362-1-yeoreum.yun@arm.com/ from v1 to v2: - remove empty v9.6 menu entry - locate HAS_LUSI in cpucaps in order - https://lore.kernel.org/all/20250611104916.10636-1-yeoreum.yun@arm.com/ Yeoreum Yun (7): arm64: cpufeature: add FEAT_LSUI KVM/arm64: expose FEAT_LSUI to guest arm64/Kconfig: add LSUI Kconfig arm64/futex: move futex atomic logic with clearing PAN bit arm64/futex: add futex atomic operation with FEAT_LSUI arm64/asm: introduce lsui.h arm64/futex: support futex with FEAT_LSUI arch/arm64/Kconfig | 9 ++ arch/arm64/include/asm/futex.h | 99 ++++++------------- arch/arm64/include/asm/futex_ll_sc_u.h | 115 +++++++++++++++++++++ arch/arm64/include/asm/futex_lsui.h | 132 +++++++++++++++++++++++++ arch/arm64/include/asm/lsui.h | 37 +++++++ arch/arm64/kernel/cpufeature.c | 8 ++ arch/arm64/kvm/sys_regs.c | 5 +- arch/arm64/tools/cpucaps | 1 + 8 files changed, 336 insertions(+), 70 deletions(-) create mode 100644 arch/arm64/include/asm/futex_ll_sc_u.h create mode 100644 arch/arm64/include/asm/futex_lsui.h create mode 100644 arch/arm64/include/asm/lsui.h -- LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}