From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88754FC6196 for ; Fri, 8 Nov 2019 14:43:03 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 4AE0D214DB for ; Fri, 8 Nov 2019 14:43:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AE0D214DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 038494ACC9; Fri, 8 Nov 2019 09:43:03 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WhPkalmU40vp; Fri, 8 Nov 2019 09:43:02 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 03BDE4AEC8; Fri, 8 Nov 2019 09:43:00 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3AECE4A946 for ; Fri, 8 Nov 2019 09:42:59 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tywe-GBAIvBl for ; Fri, 8 Nov 2019 09:42:58 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 904AC4AED4 for ; Fri, 8 Nov 2019 09:42:57 -0500 (EST) 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 35BC7DA7; Fri, 8 Nov 2019 06:42:57 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 187D13F719; Fri, 8 Nov 2019 06:42:55 -0800 (PST) From: Andre Przywara To: Andrew Jones , Paolo Bonzini Subject: [kvm-unit-tests PATCH 05/17] arm: gic: Prepare IRQ handler for handling SPIs Date: Fri, 8 Nov 2019 14:42:28 +0000 Message-Id: <20191108144240.204202-6-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191108144240.204202-1-andre.przywara@arm.com> References: <20191108144240.204202-1-andre.przywara@arm.com> Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu So far our IRQ handler routine checks that the received IRQ is actually the one SGI (IPI) that we are using for our testing. To make the IRQ testing routine more versatile, also allow the IRQ to be one test SPI (shared interrupt). We use the penultimate IRQ of the first SPI group for that purpose. Signed-off-by: Andre Przywara --- arm/gic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arm/gic.c b/arm/gic.c index eca9188..c909668 100644 --- a/arm/gic.c +++ b/arm/gic.c @@ -23,6 +23,7 @@ #define IPI_SENDER 1 #define IPI_IRQ 1 +#define SPI_IRQ (GIC_FIRST_SPI + 30) struct gic { struct { @@ -162,8 +163,12 @@ static void irq_handler(struct pt_regs *regs __unused) smp_rmb(); /* pairs with wmb in stats_reset */ ++acked[smp_processor_id()]; - check_ipi_sender(irqstat); - check_irqnr(irqnr, IPI_IRQ); + if (irqnr < GIC_NR_PRIVATE_IRQS) { + check_ipi_sender(irqstat); + check_irqnr(irqnr, IPI_IRQ); + } else { + check_irqnr(irqnr, SPI_IRQ); + } smp_wmb(); /* pairs with rmb in check_acked */ } -- 2.17.1 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm