Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp761324iob; Thu, 12 May 2022 04:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZgiGKU4IU0m/RDX3MmkXTZbSDO9MxAjuzUMqZeV3spXnseyzh+V8KgB5IfGse0xkmwxPp X-Received: by 2002:a17:902:cecb:b0:15e:8ddd:c7b1 with SMTP id d11-20020a170902cecb00b0015e8dddc7b1mr29094738plg.105.1652354035096; Thu, 12 May 2022 04:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652354035; cv=none; d=google.com; s=arc-20160816; b=RZ8/1fhuwdsDGs0tvYEyhbDl1PULNvdsLT1DdBGgjVzFnBiRLr6k6AtPMDaeUboej7 JSjbR3zer4GurSn9veP3Cee+EkX1J0oJN5NR5S/X7sM96/O2hV86G3Devl3ewzGaLyvV RaQlvBXyvFmhTI0jalIKNxzEQL990eKN8iUQ8Fs6UgGzYeDgkVguQUn/rEYmQY516r0S naTGs3aRlTX1YZv+RIXVO1tJKuhX9IpORO45JLAx2D9Yb69ztlgEsSltnlYyrKLABTA3 TtFP9m5hIqYBGSw4I6G3BNzjblJEsBZGX4LvwouQcVMAM4ZLr3ToF5gXC92a4SxyurcF 5Utg== 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=qr5+oOuhMOip9ULsjUBIqtGMG/98NAPKb1sP/AvCeRY=; b=S5rXMbHN/9qiwaV2WPVMYIlgKuXjWfy55rcqNhnhenvJ1uvhU9Gxtcs1XQfRCjvGJo VCm2PbMc7ZO6T9l47Ze7D6YxYrVlQw99ZeDCjeM95IbIFJV7V7q8sR8ZmXcu/rXc7ItU 2jgGHyMj/yi+Nucemq8sXohM6Opwla3NA+t6WmwGITTl31ERSDI2X58me7kHfJnJBsoU vCpO2260oh5BI3h95wbD72UAHdjjvaXe8r4L0oiGnaQPJWNFDSeF3iwYQDB7NsDyDvUU tfGk0E1J+Kwo4IWC/RVgZaAfFHHfyRj+kHBTPZ+HfcINxPfkGvASCUcQ2WOaHha5RSG1 h/8g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 12-20020a630b0c000000b0039908cd4e78si3360778pgl.263.2022.05.12.04.13.41; Thu, 12 May 2022 04:13:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348326AbiEKVlr (ORCPT + 99 others); Wed, 11 May 2022 17:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347797AbiEKVln (ORCPT ); Wed, 11 May 2022 17:41:43 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87EC15C77B; Wed, 11 May 2022 14:41:42 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nou5O-0005NU-3o; Wed, 11 May 2022 23:41:34 +0200 From: Heiko Stuebner To: palmer@dabbelt.com, paul.walmsley@sifive.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, wefu@redhat.com, guoren@kernel.org, atishp@atishpatra.org, anup@brainfault.org, mick@ics.forth.gr, samuel@sholland.org, cmuellner@linux.com, philipp.tomsich@vrull.eu, robh+dt@kernel.org, krzk+dt@kernel.org, devicetree@vger.kernel.org, Heiko Stuebner Subject: [PATCH v2 0/2] riscv: implement Zicbom-based CMO instructions + the t-head variant Date: Wed, 11 May 2022 23:41:29 +0200 Message-Id: <20220511214132.2281431-1-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_NONE, 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 This series is based on the alternatives changes done in my svpbmt series and thus also depends on Atish's isa-extension parsing series. It implements using the cache-management instructions from the Zicbom- extension to handle cache flush, etc actions on platforms needing them. SoCs using cpu cores from T-Head like the Allwinne D1 implement a different set of cache instructions. But while they are different, instructions they provide the same functionality, so a variant can easly hook into the existing alternatives mechanism on those. As Palmer suggested, merging might have to wait until the cache instructions have landed in compilers, but I wanted to put the block-size changes out there for people to look at already and also update the series to match the current svpbmt state. changes in v2: - cbom-block-size is hardware-specific and comes from firmware - update Kconfig name to use the ISA extension name - select the ALTERNATIVES symbol when enabled - shorten the line lengths of the errata-assembly Heiko Stuebner (3): dt-bindings: riscv: document cbom-block-size riscv: Implement Zicbom-based cache management operations riscv: implement cache-management errata for T-Head SoCs .../devicetree/bindings/riscv/cpus.yaml | 7 ++ arch/riscv/Kconfig | 15 +++ arch/riscv/Kconfig.erratas | 10 ++ arch/riscv/errata/thead/errata.c | 5 + arch/riscv/include/asm/cacheflush.h | 6 ++ arch/riscv/include/asm/errata_list.h | 80 +++++++++++++++- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpu.c | 1 + arch/riscv/kernel/cpufeature.c | 17 ++++ arch/riscv/kernel/setup.c | 2 + arch/riscv/mm/Makefile | 1 + arch/riscv/mm/dma-noncoherent.c | 92 +++++++++++++++++++ 12 files changed, 235 insertions(+), 2 deletions(-) create mode 100644 arch/riscv/mm/dma-noncoherent.c -- 2.35.1