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.3 required=3.0 tests=BAYES_00, 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=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 E0A2DC48BD1 for ; Fri, 11 Jun 2021 16:58:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C185A613CC for ; Fri, 11 Jun 2021 16:58:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbhFKRAb (ORCPT ); Fri, 11 Jun 2021 13:00:31 -0400 Received: from foss.arm.com ([217.140.110.172]:35412 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbhFKRAa (ORCPT ); Fri, 11 Jun 2021 13:00:30 -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 F31CFD6E; Fri, 11 Jun 2021 09:58:31 -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 81E6B3F719; Fri, 11 Jun 2021 09:58:30 -0700 (PDT) Subject: Re: [PATCH v4 3/9] KVM: arm64: vgic: Be tolerant to the lack of maintenance interrupt masking From: Alexandru Elisei 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> Message-ID: Date: Fri, 11 Jun 2021 17:59:26 +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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Marc, On 6/11/21 5:38 PM, Alexandru Elisei wrote: > 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? Actually, after another look, the current name stopped looking awkward to me. Thanks, Alex