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 396C3C4332F for ; Fri, 18 Nov 2022 16:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zNoIYodFF/4kTDG2uxJnnKl8UDHhEw9wWrET+TFbazU=; b=dMAbPrBg1282yQ 0PgWznFOe//CsCI82bB4f8/QBT3WXAuYzPvWMbViUmDtgrTvvuq1wX2+z0gWMPrN4djqY4pvf/odS WI2/qu+Lz1tWYACEZaIuNN3tLaUBROpMBwrt9dRa9VxSU84WhywiUigyCdn9Rfm4b2vAVrlrlEUPP W4HOlCQYDHvVMmKqkFMMdnCLLTU8rM4++5zo6ECoQz2hzvtg2qzh3qPIsrXPU/5HsA8U/Zv7oYem2 97wfBH9GgcfpSBuZ9ofqcB5hmarEssCKni4leF2ZO1g39XfRuO0Ms5sPmeGC4ZJYrXpSXkUxcdyfN SF+RTR+CH+Dyh7tH+xIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow48S-005GKt-40; Fri, 18 Nov 2022 16:22:36 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow48O-005GIX-8F for linux-arm-kernel@lists.infradead.org; Fri, 18 Nov 2022 16:22:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E588CB8243D; Fri, 18 Nov 2022 16:22:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB07EC433C1; Fri, 18 Nov 2022 16:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668788549; bh=m754hS6EQyyufkAoJTn0OG/tk4wntiHhkbUTD18ca4s=; h=From:To:Cc:Subject:Date:From; b=Kex+NxkVvsOehsGrKxD6Gmo833YuBogCKjo2nlIcsdfqphmH5iskbDzR72lnRKS7q SnSS//cvDlBBz0r6evatJfheIu6Mu/UQhLboee5STWgI7gnnNbDEdA6ra99vcafK3/ ZSjCCPcxTh8LrC0yFuXw2xjBJ8aJ2e09Gn1fnewMMBEMtgIwvRsgi2BWain61Gkm62 pzW+qsDosVSKBzUsUaTZW96KaSdHCokemsWEQ4TdlS5S6S+2JvP+OQBh+fXefZLI5r aDkvLBUrD77HGOpbBexrZcrPy4sJCTfttTGTUugJsA1pOfuOMTb3RxpnTBryWshwB2 wvwxQeLRAlLkw== From: Mark Brown To: Catalin Marinas , Will Deacon , Shuah Khan , Shuah Khan Cc: Szabolcs Nagy , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v3 0/5] arm64/signal: Support TPIDR2 Date: Fri, 18 Nov 2022 16:22:19 +0000 Message-Id: <20221118162224.1068916-1-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2175; i=broonie@kernel.org; h=from:subject; bh=m754hS6EQyyufkAoJTn0OG/tk4wntiHhkbUTD18ca4s=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjd7E7Zvw1+BXPMmPMcN9qTgzd0IpDmOmg0yq9sdsU VvrC7t6JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY3exOwAKCRAk1otyXVSH0MyiB/ 0YxjVFUemUg57TcMpB/Aw/pl6RemkB2/9anTGcU5YR12PaoLIrAwQEEmvzmZf4eenT6HtzYLGKeimA 6IwTJmkKTRW2H4C6+SVYC2vnmtI6RHDyNbxxwhRV3f5KpH07WnndH/q+0C+1FXIfZzcmHtawF8XroQ 3xRbODF2EvMS9QZkPNS/LUkQ5ddY67ILoG4ZHGwDbdJFGrwaf20Ar67ikTriCWDV5Hw6lqO9ibHLXz pby576t/v3yqkX3ZKFPEf9IwkVU5cFrXlbLl8b8aAgVrbK/eprOQ0dtkfaJGZqU/m07u1NlH0bW4r3 VWOWOBsVMj6JJEHyHkkn2r/bKhsC7y X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_082232_603506_FFF09596 X-CRM114-Status: GOOD ( 15.84 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When SME support was merged support for TPIDR2 in signal frames was omitted, meaning that it was not possible for signal handers to inspect or modify it. This will present an issue for programs using signals to implement lightweight threads so let's provide access to TPIDR2 in signal handlers. Implement a new record type for TPIDR2 using the same format as we use for ESR and add coverage to make sure that this appears in the signal context as expected. Due to TPIDR2 being reserved for libc we only validate that the value is unchanged, meaning we're likely to just be validating the default value of 0 on current systems. I have tested with a modified version that sets an explicit value. v3: - Load restored TPIDR2 value into the register to ensure that any changes requested by userspace are reflected in the case where we don't context switch before we return to userspace. - Use tls_preserve_current_state() to sync TPIDR2 state to the task struct. - Use system_supports_tpidr2(). - Fix mangled comment. - Update comment on prototype for tls_preserve_current_state(). v2: - Rebase onto v6.1-rc3. - Change the signal frame magic to 0x54504902 (TPI). Mark Brown (5): arm64/processor: Update documentation for tls_preserve_current_state() arm64/sme: Document ABI for TPIDR2 signal information arm64/signal: Include TPIDR2 in the signal context kselftest/arm64: Add TPIDR2 to the set of known signal context records kselftest/arm64: Add test case for TPIDR2 signal frame records Documentation/arm64/sme.rst | 3 + arch/arm64/include/asm/processor.h | 2 +- arch/arm64/include/uapi/asm/sigcontext.h | 8 ++ arch/arm64/kernel/signal.c | 61 +++++++++++++ .../testing/selftests/arm64/signal/.gitignore | 1 + .../arm64/signal/testcases/testcases.c | 4 + .../arm64/signal/testcases/tpidr2_siginfo.c | 90 +++++++++++++++++++ 7 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/arm64/signal/testcases/tpidr2_siginfo.c base-commit: 30a0b95b1335e12efef89dd78518ed3e4a71a763 -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel