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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 C6177C48BE0 for ; Fri, 11 Jun 2021 16:39:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 853046101B for ; Fri, 11 Jun 2021 16:39:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 853046101B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wE9TtrP5+5FukOVpl4WSw1WpFbAVs/Ffkxpw4Fj2skc=; b=hxwnbH3wvMdHUMoftzj576sWuN KkRAwId10eumCMgdidhuIlcE4VFIolq6w65EFXiiy6wFrrH7Tlg1iRmwNiaM1ikmQuuKiaEe1IcuQ HsWh7psdAmTkoC7rbc8G5Bx+SATImWWKblQfo7DPGlHO3V4L0JgTzExk0T9+mxZXUEKATqTgelE64 DfFfXIuBz4pks//VbYPqi+tjEA/h+30KI1hdOu4Y7I/K+1KjzXcLPxPlLO9EIWCOcSPLVUa3GjydP BDEoaYKU0DnVSBs7W5aIF/H4UhrHRlaoF1GBx9dKe4dINZqyWbrt1+UqDZHAfZmnkEGsqNrY9mzmx rYdLRj8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrkAH-0063LP-GL; Fri, 11 Jun 2021 16:37:49 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrkAD-0063Ki-Kv for linux-arm-kernel@lists.infradead.org; Fri, 11 Jun 2021 16:37:47 +0000 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 CAE61D6E; Fri, 11 Jun 2021 09:37:42 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6145B3F719; Fri, 11 Jun 2021 09:37:41 -0700 (PDT) Subject: Re: [PATCH v4 3/9] KVM: arm64: vgic: Be tolerant to the lack of maintenance interrupt masking To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: James Morse , Suzuki K Poulose , Eric Auger , Hector Martin , Mark Rutland , Zenghui Yu , kernel-team@android.com References: <20210601104005.81332-1-maz@kernel.org> <20210601104005.81332-4-maz@kernel.org> From: Alexandru Elisei Message-ID: Date: Fri, 11 Jun 2021 17:38:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210601104005.81332-4-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210611_093745_765792_B4EAFED4 X-CRM114-Status: GOOD ( 24.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Marc, On 6/1/21 11:39 AM, Marc Zyngier wrote: > As it turns out, not all the interrupt controllers are able to > expose a vGIC maintenance interrupt that can be independently > enabled/disabled. > > And to be fair, it doesn't really matter as all we require is > for the interrupt to kick us out of guest mode out way or another. > > To that effect, add gic_kvm_info.no_maint_irq_mask for an interrupt > controller to advertise the lack of masking. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/vgic/vgic-init.c | 8 +++++++- > include/linux/irqchip/arm-vgic-info.h | 2 ++ > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c > index 2fdb65529594..6752d084934d 100644 > --- a/arch/arm64/kvm/vgic/vgic-init.c > +++ b/arch/arm64/kvm/vgic/vgic-init.c > @@ -519,12 +519,15 @@ void kvm_vgic_init_cpu_hardware(void) > */ > int kvm_vgic_hyp_init(void) > { > + bool has_mask; > int ret; > > if (!gic_kvm_info) > return -ENODEV; > > - if (!gic_kvm_info->maint_irq) { > + has_mask = !gic_kvm_info->no_maint_irq_mask; This double negative is pretty awkward, I suppose this was done to avoid changes to the gic drivers, because the default value is 0 (false). Just an idea, maybe renaming it to maint_irq_unmaskable would be more readable? Other than that, the patch looks good: Reviewed-by: Alexandru Elisei Thanks, Alex > + > + if (has_mask && !gic_kvm_info->maint_irq) { > kvm_err("No vgic maintenance irq\n"); > return -ENXIO; > } > @@ -552,6 +555,9 @@ int kvm_vgic_hyp_init(void) > if (ret) > return ret; > > + if (!has_mask) > + return 0; > + > ret = request_percpu_irq(kvm_vgic_global_state.maint_irq, > vgic_maintenance_handler, > "vgic", kvm_get_running_vcpus()); > diff --git a/include/linux/irqchip/arm-vgic-info.h b/include/linux/irqchip/arm-vgic-info.h > index a25d4da5697d..7c0d08ebb82c 100644 > --- a/include/linux/irqchip/arm-vgic-info.h > +++ b/include/linux/irqchip/arm-vgic-info.h > @@ -24,6 +24,8 @@ struct gic_kvm_info { > struct resource vcpu; > /* Interrupt number */ > unsigned int maint_irq; > + /* No interrupt mask, no need to use the above field */ > + bool no_maint_irq_mask; > /* Virtual control interface */ > struct resource vctrl; > /* vlpi support */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel