From patchwork Sat Apr 8 10:45:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 81154 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp802595vqo; Sat, 8 Apr 2023 03:58:48 -0700 (PDT) X-Google-Smtp-Source: AKy350YD/NCXnBgg9X37XL69cRZb2LSXC4iEnzU7g/eApnmRTJKgKp/DTKhaXMpPn2PjBTmR/M96 X-Received: by 2002:a17:90a:ab0d:b0:23b:2f4a:57bb with SMTP id m13-20020a17090aab0d00b0023b2f4a57bbmr5988512pjq.10.1680951527732; Sat, 08 Apr 2023 03:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680951527; cv=none; d=google.com; s=arc-20160816; b=NxyFtjxIoYFDkG1ZIertiYrfYu48hF6SWlg6iGBOTgszTJh+ouV+iSMZCf+3yAd8CT X6lit0EkfLbJv9MOeqoF48YS3YfqNyxskk4DATCAmoYWKl4f6BpngC6ngnAm2V5kvQD4 RLnXrx7gFytTPTJ04srZdt6IIrLWOETgtNG6jzpgJdIRd70Bh/hJsyJzyt+Q7wx+fOvP e/XhChljzNNhNTnRDQYuLex6K9aBZcJbdAKPyFwnB1X0f7tJLykXSaQdGCIJlbyC7GK9 QDD5NMqPKrFY9eXeS0EWCTfTfXeTkU50P8uDFueSszrDCh0XUFeidZd34i1gzevBXmku YVog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Xhd8ABxVEwvLP+guUEK66SFARzUlg4lJcNAVxFrqFBw=; b=x2SbtCo3wQrCFYsU5CPFTn9dRSoBTyzO59sqdnYi4txsDgUaLhFspGXF+CA4iJlbo3 4kbXVcSOiPpmUtX+KrO3H012TVxFb1lk5rOc/+tR47udux5YGM8em+BL9Gr5j9klUiAy QyDdR9VhMkSQ2ecv/sX1WmlyQHd/j0pYeOZByQF9hzfcs3n5FcPlZZce0GdZdGGlahcP qx7I3agEqU3drQwO5SNMetOo0ZZjwEKr8vNWJg/PJVZPAf6RK4+NfOgVAMS4OjRgFrHk DUQwjjI75uJHePGBqv8u+g9v6znxYRhMJJJdZPLoDDNc6mBpsW8mDX/JZTvhIQ40bme2 SYlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vDAykfFM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=I+KmgS0V; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h21-20020a17090aa89500b00236405d76basi5044959pjq.72.2023.04.08.03.58.34; Sat, 08 Apr 2023 03:58:47 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vDAykfFM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=I+KmgS0V; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbjDHKsz (ORCPT + 99 others); Sat, 8 Apr 2023 06:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbjDHKso (ORCPT ); Sat, 8 Apr 2023 06:48:44 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A69F3C142 for ; Sat, 8 Apr 2023 03:48:05 -0700 (PDT) Date: Sat, 08 Apr 2023 10:45:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680950717; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xhd8ABxVEwvLP+guUEK66SFARzUlg4lJcNAVxFrqFBw=; b=vDAykfFMSHcckvr3tFSMn5GGVamUKYXbgx6fsL+NFfpmsUEsjJZCRa/9ZdMNo890SgzDQ3 sD0nA17120U2JMhZTOQjRkyVCYPVGh9tmLRqMJDY756WQuZFdHvOK6E7WcJNbJZfzA8917 do5a5iTvnvSAmFpQcrY/Msk5XnrUgooPgMWtPWb4o06qwQD7zrtXQ7VSqEYBJjhm4n1Rvv iNy7qGBFjCSLOuAD2BEfIMxqPq2wdT0xlpXt9Ykxg1sH5W/etThEgiCJ2IBuA2u8pKxd9a tGsGv+K+aZH65EpWq1uGx/c6TKUfemQ3YqVsmxlplIcidPhLNaOUCzisb+siPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680950717; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xhd8ABxVEwvLP+guUEK66SFARzUlg4lJcNAVxFrqFBw=; b=I+KmgS0VYZgVT4fJ93d2/8JvBaGS4CEKZHJgt1gIi9esg6UssRX3eRpewISuWg0P1bkPuc AFEOQqR9J1gxxcAg== From: "irqchip-bot for Anup Patel" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] RISC-V: Use IPIs for remote icache flush when possible Cc: Anup Patel , Atish Patra , Palmer Dabbelt , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20230328035223.1480939-7-apatel@ventanamicro.com> References: <20230328035223.1480939-7-apatel@ventanamicro.com> MIME-Version: 1.0 Message-ID: <168095071696.404.7766479024018397126.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1761584488966805884?= X-GMAIL-MSGID: =?utf-8?q?1762605429130951014?= The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 6279228432352f43f43f5e760771151605bf6d82 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/6279228432352f43f43f5e760771151605bf6d82 Author: Anup Patel AuthorDate: Tue, 28 Mar 2023 09:22:22 +05:30 Committer: Marc Zyngier CommitterDate: Sat, 08 Apr 2023 11:26:24 +01:00 RISC-V: Use IPIs for remote icache flush when possible If we have specialized interrupt controller (such as AIA IMSIC) which allows supervisor mode to directly inject IPIs without any assistance from M-mode or HS-mode then using such specialized interrupt controller, we can do remote icache flushe directly from supervisor mode instead of using the SBI RFENCE calls. This patch extends remote icache flush functions to use supervisor mode IPIs whenever direct supervisor mode IPIs.are supported by interrupt controller. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Acked-by: Palmer Dabbelt Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230328035223.1480939-7-apatel@ventanamicro.com --- arch/riscv/mm/cacheflush.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c index fcd6145..20cec5e 100644 --- a/arch/riscv/mm/cacheflush.c +++ b/arch/riscv/mm/cacheflush.c @@ -19,7 +19,7 @@ void flush_icache_all(void) { local_flush_icache_all(); - if (IS_ENABLED(CONFIG_RISCV_SBI)) + if (IS_ENABLED(CONFIG_RISCV_SBI) && !riscv_use_ipi_for_rfence()) sbi_remote_fence_i(NULL); else on_each_cpu(ipi_remote_fence_i, NULL, 1); @@ -67,7 +67,8 @@ void flush_icache_mm(struct mm_struct *mm, bool local) * with flush_icache_deferred(). */ smp_mb(); - } else if (IS_ENABLED(CONFIG_RISCV_SBI)) { + } else if (IS_ENABLED(CONFIG_RISCV_SBI) && + !riscv_use_ipi_for_rfence()) { sbi_remote_fence_i(&others); } else { on_each_cpu_mask(&others, ipi_remote_fence_i, NULL, 1);