Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1232899pxb; Thu, 21 Oct 2021 19:02:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUj0YRAv6rQgkHpN+FjqsiAzes04QHznK7cLln3W00OPpxeaC/TKhrS0GB0XQMdXr+yPtk X-Received: by 2002:a63:7e11:: with SMTP id z17mr7155641pgc.112.1634868152921; Thu, 21 Oct 2021 19:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634868152; cv=none; d=google.com; s=arc-20160816; b=Bfrmbai/bhXicpi6qQK+eSppaGrlbiGHKiCrHjSvc4U/FCFyIaYBR0Q6Q4JY6UgR5o LIb/A7UHFoa/m2im+j/HwiK/BMXPbVJIU0Pjhdv8nwlmw0WvOFZBAGqxb0726sE1XbbV OctPNHw2rA2VlRDflNjgVk0NMynyNSSIbAVJYi5vWUJIFsvRvJnYYWNJUQxiNnaVXyza tXGD6nrI8kMLQ5CPy8KpIEsYBC3Z9QKFKo4AWKIUT8+8v0aAYCBYT6jSkZlyl+qch/+V cM1jnSbXFHzvEIrH3M+Kjp5ZVEwvYsTAXD8oPhklWGM7mwI9uyk/S53NRWhXWO4S/5qH CL7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=izd7GiIUJ/uc6NBheolc0jnF3kUD8jn9IPCAR+BG6lw=; b=vqJz5WRw/7GmmPx3nFLYpymAd62nsRvEuRO/nlaCGUXnlGXdMSTg6nMmfPYeHH0pLw bQd/+kPupubptowYUR+bF+8h4MEvD/l8Q0sXPyG8j6YkTjE5kFni3oOa427oA6oYSicC uotWroN5kK/qkbyQN6jQ/rINhHVVxQlDcW/wYxF/dUaowoTosDLrqvlZlkrgwgtr2uev HKZPaiHV2Soq6nYytudxzh+z5PqvIZBsiWpNi6aysalvJaDIWxzFFCObIEiO0WPAh7+K j6e2g1AOORmCoXieUj8SisLxt8Gwtu64a9OZDjUONtXUa5WpAb4VIDfSP9yNeGKk3K3M s5xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EAcsXZK4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si8255995pls.228.2021.10.21.19.02.18; Thu, 21 Oct 2021 19:02:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EAcsXZK4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231603AbhJVCCZ (ORCPT + 99 others); Thu, 21 Oct 2021 22:02:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:52426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbhJVCCY (ORCPT ); Thu, 21 Oct 2021 22:02:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C95136103E for ; Fri, 22 Oct 2021 02:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634868007; bh=VfCSA663SgKRdVNeL2NBXaB4LcnB9tiuZiI7LrO/Ypo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EAcsXZK4H5ivs+5OjW1UF2W0Iq6xShdppzqvZCRF9R0C+xRumIDRLDth1UVLlQtuH NXvXl7k2TCOGKbdgdhMqco26+UQqwqULtVt2I3AcNT2KPa1vbG7fip8TiwBZJMX6u6 zJVgl/PVOWmoP+aBKZolqm0DLb7zdd7hTL5WSBpeUdR3M0Q2Y8bcOC6L77n+1WvP1n uXjKbNbniuZXyR3B6ho9u6CHkcu/LgwyAMG/IASxmdkqOLvhuqXHShyW1Z9qNiw4Cz lV9xFBQAls8sj+Fm0HJ86QJyWKWp0epgh0KBdUmhy6l7LXpqt/PVpWfAyPiaTHROMs 86Rl8idZ8wZCQ== Received: by mail-ua1-f51.google.com with SMTP id u5so4806522uao.13 for ; Thu, 21 Oct 2021 19:00:07 -0700 (PDT) X-Gm-Message-State: AOAM5328axQATeloIfL9/woyGvToLhm4pJg/6aNJ7c/OocUlaFVG+at2 33gLGJyuas/55LHplreFedoj853k/4Ujn2pTUgs= X-Received: by 2002:ab0:3c4d:: with SMTP id u13mr11773257uaw.66.1634868006934; Thu, 21 Oct 2021 19:00:06 -0700 (PDT) MIME-Version: 1.0 References: <20211021180236.37428-1-mark.rutland@arm.com> <20211021180236.37428-14-mark.rutland@arm.com> In-Reply-To: <20211021180236.37428-14-mark.rutland@arm.com> From: Guo Ren Date: Fri, 22 Oct 2021 09:59:56 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 13/15] irq: riscv: perform irqentry in entry code To: Mark Rutland Cc: Linux Kernel Mailing List , Albert Ou , Catalin Marinas , Vincent Chen , Greentime Hu , Jonas Bonn , kernelfans@gmail.com, Linux ARM , Russell King , Marc Zyngier , Nick Hu , Palmer Dabbelt , Paul McKenney , Paul Walmsley , Peter Zijlstra , Stafford Horne , Stefan Kristiansson , Thomas Gleixner , Linus Torvalds , Thomas Bogendoerfer , vgupta@kernel.org, Will Deacon Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Guo Ren On Fri, Oct 22, 2021 at 2:03 AM Mark Rutland wrote: > > In preparation for removing HANDLE_DOMAIN_IRQ_IRQENTRY, have arch/riscv > perform all the irqentry accounting in its entry code. As arch/riscv > uses GENERIC_IRQ_MULTI_HANDLER, we can use generic_handle_arch_irq() to > do so. > > Since generic_handle_arch_irq() handles the irq entry and setting the > irq regs, and happens before the irqchip code calls handle_IPI(), we can > remove the redundant irq entry and irq regs manipulation from > handle_IPI(). > > There should be no functional change as a result of this patch. > > Signed-off-by: Mark Rutland > Cc: Albert Ou > Cc: Marc Zyngier > Cc: Palmer Dabbelt > Cc: Paul Walmsley > Cc: Thomas Gleixner > --- > arch/riscv/Kconfig | 1 - > arch/riscv/kernel/entry.S | 3 +-- > arch/riscv/kernel/smp.c | 9 +-------- > 3 files changed, 2 insertions(+), 11 deletions(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 740653063a56..301a54233c7e 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -63,7 +63,6 @@ config RISCV > select GENERIC_SMP_IDLE_THREAD > select GENERIC_TIME_VSYSCALL if MMU && 64BIT > select HANDLE_DOMAIN_IRQ > - select HANDLE_DOMAIN_IRQ_IRQENTRY > select HAVE_ARCH_AUDITSYSCALL > select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL > select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL > diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S > index 98f502654edd..64236f7efde5 100644 > --- a/arch/riscv/kernel/entry.S > +++ b/arch/riscv/kernel/entry.S > @@ -130,8 +130,7 @@ skip_context_tracking: > > /* Handle interrupts */ > move a0, sp /* pt_regs */ > - la a1, handle_arch_irq > - REG_L a1, (a1) > + la a1, generic_handle_arch_irq > jr a1 > 1: > /* > diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c > index 921d9d7df400..2f6da845c9ae 100644 > --- a/arch/riscv/kernel/smp.c > +++ b/arch/riscv/kernel/smp.c > @@ -140,12 +140,9 @@ void arch_irq_work_raise(void) > > void handle_IPI(struct pt_regs *regs) > { > - struct pt_regs *old_regs = set_irq_regs(regs); > unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits; > unsigned long *stats = ipi_data[smp_processor_id()].stats; > > - irq_enter(); > - > riscv_clear_ipi(); > > while (true) { > @@ -156,7 +153,7 @@ void handle_IPI(struct pt_regs *regs) > > ops = xchg(pending_ipis, 0); > if (ops == 0) > - goto done; > + return; > > if (ops & (1 << IPI_RESCHEDULE)) { > stats[IPI_RESCHEDULE]++; > @@ -189,10 +186,6 @@ void handle_IPI(struct pt_regs *regs) > /* Order data access and bit testing. */ > mb(); > } > - > -done: > - irq_exit(); > - set_irq_regs(old_regs); > } > > static const char * const ipi_names[] = { > -- > 2.11.0 > -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/