Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7496610ybl; Tue, 24 Dec 2019 03:43:02 -0800 (PST) X-Google-Smtp-Source: APXvYqz/IxldJMY/0yg5CvU8zJbORGvCqLzjWj0UV7RHNO5MGwrfsDW3P5NsBHfy242YvoTn5oAL X-Received: by 2002:a9d:74c7:: with SMTP id a7mr39326257otl.7.1577187782024; Tue, 24 Dec 2019 03:43:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577187782; cv=none; d=google.com; s=arc-20160816; b=D3yqX9hZlQqwr8YA+Qdyc6wXKqsSjywVNCWEo3JRdQeVch/oLAJWP39P90AxVAzZut 7FGnsOvuVHMsXNVwhV4wIJa1gLwLl/Eh71roTEmJH2cg1Hnzf3QMbkIeiVJUFUzjymJ+ GgS387Aq5IMla4bzvH/2Wl1oFP9sN/fLgFoux7WpnUjSrP3HdxvBGAV2TatBbu20my18 Ms0/DSpZ0gbeE9hw8ZD/45Bh7HZVTU+gyBJEEBeOP1lE3H2HuD133mtQi8JUuikObi+A 1pRvayWB01H+ShLy9+ApGjoenKmLS/tk6/FCR7LNyPySVjWRmH9B802fQjXuL1sGOncm m/2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hidPWnvwb3riFGxikdbTHAWB7zuo/JU8KvBpVcnqAaI=; b=pZE1XPScWo0eyBUeFV6FZPeclXO48WaoARf/YDOnr+69hT2L9oEDorJ3ZSmq7QC2rL EgMUGJIj2rbBX4aPWn4ZM1Suh3JQecK8OmlGdwMz5PpNfAK5xy7mxjkOadTsSefZGWH8 F0JIE6w0Br4yEs13JjgT8aiHSbu6ZholN/6VsqrtQx0BrFLAYp5QxHTMnk6bQD7zpAMh myN/+H6mQWFnUO0Fb8Lq9pjd71iVHhGiVdGKjSN3LWTglxs/zPRfnVeHEKgBRbutTGK3 92fC47nUD8sgn/0txOP/yT+73G+vIYU8ejUc7zIVSspTf2xoaMLvH7JeH9KHGrpuUSIf ZSiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k84si8753672oib.46.2019.12.24.03.42.51; Tue, 24 Dec 2019 03:43:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727138AbfLXLlo (ORCPT + 99 others); Tue, 24 Dec 2019 06:41:44 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:48323 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbfLXLln (ORCPT ); Tue, 24 Dec 2019 06:41:43 -0500 Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:DHE-RSA-AES128-GCM-SHA256:128) (Exim 4.80) (envelope-from ) id 1iji60-000169-9h; Tue, 24 Dec 2019 12:11:24 +0100 From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose , Thomas Gleixner , Jason Cooper , Lorenzo Pieralisi , Andrew Murray , Zenghui Yu , Robert Richter Subject: [PATCH v3 16/32] irqchip/gic-v4.1: Advertise support v4.1 to KVM Date: Tue, 24 Dec 2019 11:10:39 +0000 Message-Id: <20191224111055.11836-17-maz@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191224111055.11836-1-maz@kernel.org> References: <20191224111055.11836-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, eric.auger@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, tglx@linutronix.de, jason@lakedaemon.net, lorenzo.pieralisi@arm.com, Andrew.Murray@arm.com, yuzenghui@huawei.com, rrichter@marvell.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tell KVM that we support v4.1. Nothing uses this information so far. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 9 ++++++++- drivers/irqchip/irq-gic-v3.c | 2 ++ include/linux/irqchip/arm-gic-common.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 360ca2c1533f..48d7ee443544 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4739,6 +4739,7 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, struct device_node *of_node; struct its_node *its; bool has_v4 = false; + bool has_v4_1 = false; int err; gic_rdists = rdists; @@ -4759,8 +4760,14 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, if (err) return err; - list_for_each_entry(its, &its_nodes, entry) + list_for_each_entry(its, &its_nodes, entry) { has_v4 |= is_v4(its); + has_v4_1 |= is_v4_1(its); + } + + /* Don't bother with inconsistent systems */ + if (WARN_ON(!has_v4_1 && rdists->has_rvpeid)) + rdists->has_rvpeid = false; if (has_v4 & rdists->has_vlpis) { if (its_init_vpe_domain() || diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 624f351c0362..fcbd220c92b3 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1784,6 +1784,7 @@ static void __init gic_of_setup_kvm_info(struct device_node *node) gic_v3_kvm_info.vcpu = r; gic_v3_kvm_info.has_v4 = gic_data.rdists.has_vlpis; + gic_v3_kvm_info.has_v4_1 = gic_data.rdists.has_rvpeid; gic_set_kvm_info(&gic_v3_kvm_info); } @@ -2094,6 +2095,7 @@ static void __init gic_acpi_setup_kvm_info(void) } gic_v3_kvm_info.has_v4 = gic_data.rdists.has_vlpis; + gic_v3_kvm_info.has_v4_1 = gic_data.rdists.has_rvpeid; gic_set_kvm_info(&gic_v3_kvm_info); } diff --git a/include/linux/irqchip/arm-gic-common.h b/include/linux/irqchip/arm-gic-common.h index b9850f5f1906..fa8c0455c352 100644 --- a/include/linux/irqchip/arm-gic-common.h +++ b/include/linux/irqchip/arm-gic-common.h @@ -32,6 +32,8 @@ struct gic_kvm_info { struct resource vctrl; /* vlpi support */ bool has_v4; + /* rvpeid support */ + bool has_v4_1; }; const struct gic_kvm_info *gic_get_kvm_info(void); -- 2.20.1