Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4881780ybf; Wed, 4 Mar 2020 12:36:35 -0800 (PST) X-Google-Smtp-Source: ADFU+vvxdNuWKqiP4b4JJ36UPrTgIqcGVW5M6rQTYDTTR0G0diUfMuQ80KbOyP/kJxJBbDGPUdu+ X-Received: by 2002:a9d:4d0d:: with SMTP id n13mr3845829otf.76.1583354194911; Wed, 04 Mar 2020 12:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583354194; cv=none; d=google.com; s=arc-20160816; b=dNit+Qc6i+kRlQYFis6evNFdITW0iu7Z14wlszr9Jg4bZ4+o+J47UFUjTVvKSdY5hC iYGYANH514PMeA7oS+DplWDnO5u0skZIqGJQQLGlmo1TwyQ6WQJkqxh2higKg/FzFGr6 Kfsb1DFpoIegewkYpgp/3QqdV5E5DEqc21uYKbDLtgy51PfNLePp2ggxSSwUGSGul3N8 vB8RsvifMbmYR4pck8DPC+sm5P48h8p/Qmi0XHkWesoRxATsQYUov4RJf9SSBN2ErLVa M+EFI96JpquBn/5dgrNfRAmsF6M80hi5FRQM6RXoWsLswi8egkSCx1P7YdNO1hav1/uf 6WZA== 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 :dkim-signature; bh=LqV74VlvMCMgbbEfDlyG5GUUb4C/HsxHSzUyk6wDZG8=; b=XdW+b9z+qr19hI2t4ILjEZJ33cYlJc/vHnjp7uUVVkqw1UkLiHJvdzGpKzMMj2lU9J Xt/kDdTajfDQ6retbd6CNoVhaIy6ALsrHdfRt/vRLdsVIYK4FqzqdqZmHCa9fQximVve Q4ZDXarNA4QZj7uP7cFHZbMTn56TuTz3qhdyeMYFK/6j1O85ACj3q8WAW+aB2O7rTpxZ K7icBqFl5G9bhAjvDEa+qnWFlgTb8ER8EZhfdiN2e9GvJKF27oK05Sf9qBFdUm0Z5dUX sCz5deyj/CSAgTnPjFy0iht0yoyEawKLe9RW8w+8LO8802Ry8NxegpK/Y55KXjxuXIiQ AjVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mKT2wJ5C; 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=pass (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 x14si1875495oto.221.2020.03.04.12.36.23; Wed, 04 Mar 2020 12:36:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=mKT2wJ5C; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388440AbgCDUfF (ORCPT + 99 others); Wed, 4 Mar 2020 15:35:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:34948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387996AbgCDUeo (ORCPT ); Wed, 4 Mar 2020 15:34:44 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DDA9F24658; Wed, 4 Mar 2020 20:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583354084; bh=j8zBrkFAZYg8aOlrVLwQ6xdlqxDuQgnwUjV/YeOSDME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mKT2wJ5CATASQrCVHIrXAS4mZnE7h3hbQZ4OGF9DK/S4YNdjPBHCanpr/KJ5b4doR 7Vov2W70kxrE3d/mpqx5KMosTBEfdYtim4pqxOIDSUY3qWHg2yjMJ0tXkIdSdD94cb D7oh2IjKPIjxmA/NVeZOMcSDeJj5qBmHtRVE4Of8= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j9aj4-00A59R-4t; Wed, 04 Mar 2020 20:34:42 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lorenzo Pieralisi , Jason Cooper , Robert Richter , Thomas Gleixner , Zenghui Yu , Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose Subject: [PATCH v5 06/23] irqchip/gic-v4.1: Advertise support v4.1 to KVM Date: Wed, 4 Mar 2020 20:33:13 +0000 Message-Id: <20200304203330.4967-7-maz@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200304203330.4967-1-maz@kernel.org> References: <20200304203330.4967-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: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com, jason@lakedaemon.net, rrichter@marvell.com, tglx@linutronix.de, yuzenghui@huawei.com, eric.auger@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.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 Reviewed-by: Zenghui Yu --- 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 fc5788584df7..bcc1a0957cda 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4870,6 +4870,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; @@ -4890,8 +4891,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 ba405becab53..03e4eadefb00 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1785,6 +1785,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); } @@ -2100,6 +2101,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