Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp874548pxb; Thu, 21 Oct 2021 11:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGtq1aX/jrTDRJIrmvL4csDNCGJzzJcNU3d4enyKLIjdnze+DzYzFugwbi1TkJkyX37fkw X-Received: by 2002:a17:903:1c2:b0:13f:2893:de99 with SMTP id e2-20020a17090301c200b0013f2893de99mr6636089plh.80.1634839622767; Thu, 21 Oct 2021 11:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634839622; cv=none; d=google.com; s=arc-20160816; b=0wMFlleTpJPcxXy7nxbSjGEX5Q+aEpwW+v/XfxWKcwMn5rXOu74dix7PnugA4epyPP be+Y/wHLVeAnB9VJrrrtjidVdeqYyoSIkdy3K9WAXMrS1i26e5tIidoX6CHSirVyGsgt yX1340fMsEtlUpB67gd0ScFsuyra771lCYAX2kfsKWWMHNTajqJf1tnBkJKviUUBJCqg SbzjFgtbdeRUywvHoW6DI7Vz//26qnUOASBSJ8v/yMBdo6C42A4QDGCDpcG0JXD0L2wZ PMgscfBA94fWhBiirFddwH37dD4JEl8sYDdmt3nNk+uEmoqekI7omABb50N92t/+yjUU XpFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=3hSl5uwSCuKJO79LYqxH10P6JrFIWDgdU/xXunoXmyQ=; b=XQITmOcfBItlDCgOIf/SDc9kHKMmyuBUH8JuDaUyasBjIyoayiFCgO/9Qefkp4+MwA uLcY2ASKIG1nizBHXk0f9ed5v0mXkkHezsV60vywkGNUsFLPIZ0ojfAztTQMo9bj0+eI qrHPtM1jaXzQvI+inTznMMZ8ViK8VYigaNejw653PIemNEWii/bbSg9RohKur5ep687i jH+sOweC+Mzr3nKOa60V+ndlkiQ87mKKKsy3XdfYluUmN/ICghaD4E3etCzUmPNV3yQv tls2RwIz5+RLmTiRAeKry6DckXh/j7UyRYt1lvVgGBoSl3pS4gPkaF29QZaOq0XzBTYm i07g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si9630350plx.296.2021.10.21.11.06.49; Thu, 21 Oct 2021 11:07:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232363AbhJUSGK (ORCPT + 99 others); Thu, 21 Oct 2021 14:06:10 -0400 Received: from foss.arm.com ([217.140.110.172]:46218 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232634AbhJUSFz (ORCPT ); Thu, 21 Oct 2021 14:05:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0455F1476; Thu, 21 Oct 2021 11:03:39 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 26FC43F70D; Thu, 21 Oct 2021 11:03:36 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: aou@eecs.berkeley.edu, catalin.marinas@arm.com, deanbo422@gmail.com, green.hu@gmail.com, guoren@kernel.org, jonas@southpole.se, kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, mark.rutland@arm.com, maz@kernel.org, nickhu@andestech.com, palmer@dabbelt.com, paulmck@kernel.org, paul.walmsley@sifive.com, peterz@infradead.org, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tglx@linutronix.de, torvalds@linux-foundation.org, tsbogend@alpha.franken.de, vgupta@kernel.org, will@kernel.org Subject: [PATCH 13/15] irq: riscv: perform irqentry in entry code Date: Thu, 21 Oct 2021 19:02:34 +0100 Message-Id: <20211021180236.37428-14-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20211021180236.37428-1-mark.rutland@arm.com> References: <20211021180236.37428-1-mark.rutland@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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