From patchwork Sun Dec 31 08:29:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 18616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3418519dyb; Sun, 31 Dec 2023 00:30:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaF6UY3xCb+hOLUj31+zG6r8LnATap1KcIJpqb9qNbReeJoO2l/XhxxLv7cfibdLmR2q4i X-Received: by 2002:a17:90a:9dc9:b0:28c:b0a7:c1f9 with SMTP id x9-20020a17090a9dc900b0028cb0a7c1f9mr3838429pjv.16.1704011435190; Sun, 31 Dec 2023 00:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704011435; cv=none; d=google.com; s=arc-20160816; b=WAqko9qTCoU2rAQvtLV7miNBPoYk26gJZCEkwUNFkSkBBnUnPwrOqmwHI8PgGGAw1K 2DPmpHGBPz0VOyR1nyx2qDh47pa9aoeQpA4eJtNK6u9Q3Tmhtw2f1akg4f770v01sE6r hSfFZhD7ranXUqWS5zPJ2Qr9QNajWJ56yGxtHcV370LpBlEKZROtxTs1erhH8LFzsBqO m9G8Z0QhSiLuJ8/LjtuJUY07Drlk4oafLowY/kMMHMcWfiDnYhGqpXLnZh0d8Vkg+rL5 pUOPfiJUdhxb0d0f0YGkILI7YY4iybsvIXK0WP6s23UdRXkQgq2GA2h53ujWKBrs6k2F ZAiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=dEVzNxcv+LO3XOOYPURO4lOs8CqI3IOCEB2IhiC/EgA=; fh=8az2WX9seVnlqIwzdvRsfDVjT91R5QAYA+cOijWi0GY=; b=MWIrxxYzX/m2mLvNqjt2WiqtzTwAh37cZ89FUN+VIl3hy1PMj8bi/IXosf7A0KfeHg Et+dTCvdE2HwUHB/WCNN6wR7wG+baMDFe3yBEQSgb7VC5qwqSmXu9kPIgfI7CDYKP5CY tuLGZrm/QAjqEPOimW/hZCfmYzd+vWAXZ1rvRToST4qbv2kx+27V3ljKK2vSoxoiDfd5 TCL6RM9yo5bJDL08Al3rfjTMqEUrPvXfzdzI7+9FAhOFlxT6qW+T90WOt2eWgbb57MsW 3LZ7gVRfx5gyT4v0MqGfPLDkJS1e7wocyvD4Lm0A+jCErmfmnVtcRCNfS8fnweqnFpJC Z7XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D3VrHiZc; spf=pass (google.com: domain of linux-kernel+bounces-13651-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13651-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id nv8-20020a17090b1b4800b0028b99fe9962si17594223pjb.51.2023.12.31.00.30.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 00:30:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13651-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D3VrHiZc; spf=pass (google.com: domain of linux-kernel+bounces-13651-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13651-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CC838B21916 for ; Sun, 31 Dec 2023 08:30:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BF7D5686; Sun, 31 Dec 2023 08:30:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D3VrHiZc" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE27323D9 for ; Sun, 31 Dec 2023 08:30:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B49B3C433C7; Sun, 31 Dec 2023 08:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704011406; bh=aZhtYj/T/UdJIfbSV07e0EOQZDtYDIT0xAMU5nB5hU0=; h=From:To:Cc:Subject:Date:From; b=D3VrHiZcMw2M0LJxuM7GYDRB+1Fb/LQKhlkIV7VDradB7BcD7/1uLIRcy8sy2gzjO Oui9ZAwWD87lisYtxCBg3NgC1Ekuw+knyUqyBH2HCrLcNDtZI8xUrojoyoE2Lc9Lwz WDJKnyNIjh23gm1qbRyq3XeW+itsHf72Mwo47ZRkr89HiSFnQeUq22qpaapK9j1MZr bj6JfNvAIiXqCLG9B7xKi58so+NL+B3olYel9NIsApj8iljT24Ldi6iZMd7WOebAqL A/iDLywTaiIMiBfgcRu6QATP7wRJx9qozUH/iel95RD5bp3NKY/5VPEiKkS6mIkRbL MBOlezQSLb8QA== From: guoren@kernel.org To: paul.walmsley@sifive.com, palmer@dabbelt.com, guoren@kernel.org, panqinglin2020@iscas.ac.cn, bjorn@rivosinc.com, conor.dooley@microchip.com, leobras@redhat.com, peterz@infradead.org, keescook@chromium.org, wuwei2016@iscas.ac.cn, xiaoguang.xing@sophgo.com, chao.wei@sophgo.com, unicorn_wang@outlook.com, uwu@icenowy.me, jszhang@kernel.org, wefu@redhat.com, atishp@atishpatra.org, ajones@ventanamicro.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Guo Ren Subject: [PATCH V2 0/3] riscv: Add Zicbop & prefetchw support Date: Sun, 31 Dec 2023 03:29:50 -0500 Message-Id: <20231231082955.16516-1-guoren@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786785494824425295 X-GMAIL-MSGID: 1786785494824425295 From: Guo Ren This patch series adds Zicbop support and then enables the Linux prefetchw feature. It's based on v6.7-rc7. PATCH[1] - Add Zicbop support PATCH[2] - Add prefetchw support PATCH[3] - Enhance xchg_small Changelog: V2: - Separate from the qspinlock series - Optimize coding convention with last review advice - Add DEFINE_INSN_S type in insn-def.h - Add CBO_PREFETCH_I/R/W V1: https://lore.kernel.org/linux-riscv/20230910082911.3378782-4-guoren@kernel.org/ Guo Ren (3): riscv: Add Zicbop instruction definitions & cpufeature riscv: Add ARCH_HAS_PRETCHW support with Zibop riscv: xchg: Prefetch the destination word for sc.w arch/riscv/Kconfig | 15 ++++++++ arch/riscv/include/asm/cmpxchg.h | 4 +- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/include/asm/insn-def.h | 60 ++++++++++++++++++++++++++++++ arch/riscv/include/asm/processor.h | 16 ++++++++ arch/riscv/kernel/cpufeature.c | 1 + 6 files changed, 96 insertions(+), 1 deletion(-)