From patchwork Wed Oct 18 13:41:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10014715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7AFA60215 for ; Wed, 18 Oct 2017 13:42:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7C3828B58 for ; Wed, 18 Oct 2017 13:42:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B25A28AC8; Wed, 18 Oct 2017 13:42:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1123128AC8 for ; Wed, 18 Oct 2017 13:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EoNloqPV7bi8MN310NftFYtZFzhG9zMTEi2ef9zrIuM=; b=n4pog+Iv5bOGkr oDRYLwGP9Rjar96BQ/844LAw8ElrXzbK6JrdqEAw0P5R38j5ihTQ48l5MfgKrb6hQ9JmVVR43bLvX nQ+iTzYT/wP/z9wp2216YGgd3so3F6RS58ItI5/M3Vw+XRD7PqrLEYzUqWwJRDdXFdvN/O/xpi/y/ GXbPzFsAdrFhT9+zKuhSAgpsMIM13k4BJHbuCV+DQ0bkBYfZlmYXQX3djpnvnq1UebP7svY+yy7UA h2WFogvqt7WOGuORh+YZbLHgHYKdg52nGJwQncZ6cMNE2p+CQFL5l3YJ9RYKZUhZqe7auDatGIPud fIQcgnUsoe7OT3gHKu5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e4obu-0001ol-CI; Wed, 18 Oct 2017 13:42:14 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e4obk-0001KP-Oo for linux-arm-kernel@lists.infradead.org; Wed, 18 Oct 2017 13:42:13 +0000 Received: by mail-wm0-x244.google.com with SMTP id q124so10170603wmb.0 for ; Wed, 18 Oct 2017 06:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JzxAL/lGZi+qsGlpTXuJlzOPO9RwnfP/LfnOCR5EXKA=; b=c2qzEgX7e6F5suhlC66Aeg73FdOrqUWvvALSoXQ2eX2uO1HQBvUIk3qnwApcpawS7+ oDqM/DQ1mRu3O7SRHNdtBPNyzaD1LSkISqC6end42+vhJiRcmn2pS5uY5FCaaFajIR+s fhYFQsNJd4L5liHGTrPaHEaQTJ5GQjvqaO+E0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JzxAL/lGZi+qsGlpTXuJlzOPO9RwnfP/LfnOCR5EXKA=; b=XU5sQ7tyPCoF0AYP0tMY6tiycftONfKBR8yn9LQSySRHrfVwPje32VKCfphUuxHJwM b+MDfUn16vHTUNkTbS8Aqyn5Y5GfGLWlbSee/yIjoOYl0M5U0Nhlsk4fISXKo0XlCQCU 82xUZvlloR2Cba8yzSdQOaiX4i64FoJt+/M+gkkJXVDcW0pNdY4GSY42vfS4LxyBdeY4 JoJzB8VhJfIfRkcFYMgp2RKTtOqeWPI9ApKpfqhTCObKZsLjS6tJZesnevGokwjsnw6F NR3jOUzOis7bXRbkQpc379CvT5l84Vn7NJKAarGZ4LVXP9ahZV+53Y3tEzIkH7+Pt+j7 fkpQ== X-Gm-Message-State: AMCzsaWgFy+4IPfXQ9GckoLlC9rjQI3y9UfA5z7AOTKyEMA0afcZmv+U 1j4j12jj79CddHeHP+u63Rf6RA== X-Google-Smtp-Source: AOwi7QCIVREAJh7rpZXa3wjXfggf9ZARficIYBijJ1lSpoAnK/HlYJGCdX2er4eH0o0pW75oDVw50Q== X-Received: by 10.80.146.243 with SMTP id l48mr21477929eda.71.1508334102503; Wed, 18 Oct 2017 06:41:42 -0700 (PDT) Received: from localhost (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id b36sm9044239edd.67.2017.10.18.06.41.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 06:41:41 -0700 (PDT) Date: Wed, 18 Oct 2017 15:41:45 +0200 From: Christoffer Dall To: Marc Zyngier Subject: Re: [PATCH v3 06/20] KVM: arm/arm64: Check that system supports split eoi/deactivate Message-ID: <20171018134145.GH8900@cbox> References: <20170923004207.22356-1-cdall@linaro.org> <20170923004207.22356-7-cdall@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171018_064205_566799_024A6D3A X-CRM114-Status: GOOD ( 22.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Oct 09, 2017 at 05:47:18PM +0100, Marc Zyngier wrote: > On 23/09/17 01:41, Christoffer Dall wrote: > > Some systems without proper firmware and/or hardware description data > > don't support the split EOI and deactivate operation. > > > > On such systems, we cannot leave the physical interrupt active after the > > timer handler on the host has run, so we cannot support KVM with an > > in-kernel GIC with the timer changes we are about to introduce. > > > > This patch makes sure that trying to initialize the KVM GIC code will > > fail on such systems. > > > > Cc: Marc Zyngier > > Signed-off-by: Christoffer Dall > > --- > > drivers/irqchip/irq-gic.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c > > index f641e8e..ab12bf4 100644 > > --- a/drivers/irqchip/irq-gic.c > > +++ b/drivers/irqchip/irq-gic.c > > @@ -1420,7 +1420,8 @@ static void __init gic_of_setup_kvm_info(struct device_node *node) > > if (ret) > > return; > > > > - gic_set_kvm_info(&gic_v2_kvm_info); > > + if (static_key_true(&supports_deactivate)) > > + gic_set_kvm_info(&gic_v2_kvm_info); > > } > > > > int __init > > > > Should we add the same level of checking on the ACPI path, just for the > sake symmetry? Yes, we should, if anyone is crazy enough to use ACPI :) > > Also, do we need to add the same thing for GICv3? > Why would split EOI/deactivate not be available on GICv3, actually? It looks like this is not supported unless you have EL2, but I can't seem to find anything in the spec for this, and KVM should support EOI/deactivate for GICv3 guests I think. Am I missing something? Assuming I'm wrong about GICv3, which I probably am, how does this look (on top of the posted patch): Thanks, -Christoffer diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 519149e..aed524c 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1228,7 +1228,9 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare goto out_unmap_rdist; gic_populate_ppi_partitions(node); - gic_of_setup_kvm_info(node); + + if (static_key_true(&supports_deactivate)) + gic_of_setup_kvm_info(node); return 0; out_unmap_rdist: @@ -1517,7 +1519,9 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end) goto out_fwhandle_free; acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle); - gic_acpi_setup_kvm_info(); + + if (static_key_true(&supports_deactivate)) + gic_acpi_setup_kvm_info(); return 0; diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index ab12bf4..121af5c 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1653,7 +1653,8 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, if (IS_ENABLED(CONFIG_ARM_GIC_V2M)) gicv2m_init(NULL, gic_data[0].domain); - gic_acpi_setup_kvm_info(); + if (static_key_true(&supports_deactivate)) + gic_acpi_setup_kvm_info(); return 0; }