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: 9633 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp846438vqo; Sun, 21 May 2023 05:20:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7qI6Z5Nzgv32T+3eQtPrW/BB145D1OiAhtP8xsKOK/MSbrmPVRjySucBg+S6qwgyLsSgTd X-Received: by 2002:aa7:88d5:0:b0:63d:3c39:ecc2 with SMTP id k21-20020aa788d5000000b0063d3c39ecc2mr8404560pff.12.1684671638828; Sun, 21 May 2023 05:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684671638; cv=none; d=google.com; s=arc-20160816; b=BZIYNyFaVe1i+P5yHilEg1O7PAcBIzI0I+Yb1LazcPiQ6CjiqelOfPtHgvTbvdmV62 VFTmAVZWY5sV4VkdKNsfqefaNcqu6aNhhkq1GOs9QSO/3IzQ4VpHgNMfurqaBz6urdiR /fvUgn09pfxFQZfgsBFmBNbFtybxuSuonWwGoBZmyYBkMBVDCpaxjti4zWsog4FujcEg xAbz0B3yUbJ/VgQ7uTwZuJIM5xHKC3U19sNFYNcK9nLAxPYswLhkZf7QJYBVOhwCXnwd 3lkNVivWyLf7dig5aqo2am4SfAymqvqSa4hthXEJ0SZcF3w5wkKd7OjeEWr66iyD98aS PDzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/RuzFKVl+QUEHLM7zKauAcPQFrNTvJTHTi/MlBJIFaA=; b=UbRLt3ZO0ranrlFbbCq0LE0s3bYQuD+hTbnDeBQiJ4w8dL+da2KbG/PO/ZGqn49trJ IG5mBSnN1E8LlTwK2z7nuREAscGopOOrje02qsV6T0gK/NcntIZeehtz5DxG8Juu4wDv rFf5A+z7uaAdieU3Am60U2d3EKpZ6R2T76ps70gpynv8hxPn9RjaxB0PNy/7SGDsteRB cFgiVVBpTmZq6oFzpLUDKBFpHwW0FLOiyaICzcrf1exgWwJEsQ6KR3A32ObUMQ007b26 bPjEIOpJ0FM09CSPg2lHX03gaLzp0gV+8JZPwzc83X6ZvgdVhp2THnc+3oT9gKNgyRry Dr2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g19-20020aa796b3000000b00643ba887601si1480613pfk.307.2023.05.21.05.20.24; Sun, 21 May 2023 05:20:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231608AbjEULug (ORCPT + 99 others); Sun, 21 May 2023 07:50:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231157AbjEULti (ORCPT ); Sun, 21 May 2023 07:49:38 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D31710F8 for ; Sun, 21 May 2023 04:47:24 -0700 (PDT) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766506248519877305?= X-GMAIL-MSGID: =?utf-8?q?1766506248519877305?= 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