From patchwork Sun May 21 11:47:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 13249397 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 057A4C87FE1 for ; Sun, 21 May 2023 11:47:43 +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=C6Q3V+sEKUnpC0MwBOnfQUxdCNlwtTOI+lOQyycVB7w=; b=XDFPQF1dDGHvne ujY9/j5j8CnfbbG3YiDpbsU1g2ijY3+o2vpn2uIINFBaH3eEu6fkASJMp4l5sfEhZc9cAOboxrmqs K9Lme06Vxj82fkJxIJv7FWp30DTnXrs+mq8wZ8mvXPixeDn4hKD5g6+lJ+LSEgF4Sm5xL3ohWxRQ5 30Jdyoi1UNWC8x6eyIJtatgAW+4//qg9UWQG1B+yIRnLTgU5o0Qj+yUHW9LIEPV4VC2+2Gw99qTVx S4/kXCcWSwy1bVV3fyNfvRKNxzIaR4rPdD+QZ7v3i/EYJrZ8ZJ29IR5reiMIbYB8vZeYFOx7dPurq skI1sAyJOl3T7sFlULDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q0hX7-003nNS-1U; Sun, 21 May 2023 11:47:29 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q0hX3-003nLZ-1Y for linux-riscv@lists.infradead.org; Sun, 21 May 2023 11:47:26 +0000 Received: from ip5b412278.dynamic.kabel-deutschland.de ([91.65.34.120] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q0hWu-0008T6-Os; Sun, 21 May 2023 13:47:16 +0200 From: Heiko Stuebner To: linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com Cc: linux-kernel@vger.kernel.org, christoph.muellner@vrull.eu, David.Laight@ACULAB.COM, Heiko Stuebner Subject: [PATCH v3 0/2] Add Zawrs support and use it for spinlocks Date: Sun, 21 May 2023 13:47:13 +0200 Message-Id: <20230521114715.955823-1-heiko.stuebner@vrull.eu> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230521_044725_524098_AC1F624F X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Heiko Stuebner Zawrs [0] was ratified in november 2022 [1], so I've resurrect the patch adding Zawrs support for spinlocks and adapted it to recent kernel changes. Also incorporated are the nice comments David Laight provided on v2. Changes since v2: - Rebase on top of 6.4-rc1 - Adapt to changed alternatives Kconfig handling - Adapt to changed cpufeature extension handling - Address review comments from David Laight - better handling for 32/64bit cases (less ifdefery) - less macros calling macros - don't duplicate __smp_load_reserved_relaxed in __smp_load_reserved_aquire Changes since v1: - Fixing type checking code for 32/64-bit values - Adjustments according to the specification change - Adding "depends on !XIP_KERNEL" to RISCV_ISA_ZAWRS [0] https://github.com/riscv/riscv-zawrs/blob/main/zawrs.adoc [1] https://github.com/riscv/riscv-zawrs/commit/9ff54f7e7fcd95cf1b111d2e54276ff1183bcd37 Christoph Müllner (1): riscv: Add Zawrs support for spinlocks Heiko Stuebner (1): riscv: don't include kernel.h into alternative.h arch/riscv/Kconfig | 10 +++++ arch/riscv/include/asm/alternative.h | 1 - arch/riscv/include/asm/barrier.h | 64 ++++++++++++++++++++++++++++ arch/riscv/include/asm/errata_list.h | 14 ++++++ arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpu.c | 1 + arch/riscv/kernel/cpufeature.c | 1 + 7 files changed, 91 insertions(+), 1 deletion(-) Signed-off-by: Andrea Parri