Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7497155ybl; Tue, 24 Dec 2019 03:43:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzHU9ub6tCHOEx6QeAK0h38imbHYTPTuEj/90pTznJ8lYyMvm7FKBaXkl6MbFkZDcClmVjj X-Received: by 2002:a05:6830:1e37:: with SMTP id t23mr38805164otr.16.1577187822837; Tue, 24 Dec 2019 03:43:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577187822; cv=none; d=google.com; s=arc-20160816; b=gXnp5ECEzqZoOba5XPa1xNP/JSVR/GVsMNPdlTOHotpNCJcIh7CyFcqV8mwRZVyKQi AafbF+x5WLr9wpLpcmQPfKPbEq+V7X8oV1xOfXSh2f/S+oEqqMmLCTKPH7FB6lIgTD9V 3kk4ls723gGMqJAzxI0I8b7LytFR9saTs5wUl05JTxg+hzZJuTiXswGXWPoRsFf0VeE4 zdbOeVvIsaM0IJjNT0OjMdLM9kERfagryzF9TwIi0k/MD0XWa361+aNAkm/M6ww7mnzr NwPv1cKG+Gg7FLRf0N01KTLXsFwd3sjoAdl0L9/NwKPO2+tog9g/uBrBlnJeQyzLeP8O 1HiQ== 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=Xp+1nQ9jocb63W28iAj2bj+nei5Dn/FLvmZCyV1QkN8=; b=BRk2aTOqN0bO4AtPNykCHBJpmqnT87Ss3ZboHWVO8hA46oW8cChMnFiqATohEF5Sbz yq26mSBCsMJPF4KFP7H5TQyUCn1VuTuAhVpKO8P80hU0kyusgxPiaTY4QGy1v6FSeI0u mkMkI4nk8IrlB9gU3e2LFpQdm/JKAQJPS44ievW/6XbDiDVI+/JMTICieqFiag3S2AN3 auGAh+HkPbj3C/cIqH4MF+C20X4PjSM4NTnULRaMC7BKJiT01yBhdkgKuW/RhdawwPx6 5nP0MnDX6uGEeNVcyzBl2WZycFU+ahYSDmbWIoChkGtIw16l0hSpGpk6jidYyzprSPjm UrMA== 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 v26si12226072otj.0.2019.12.24.03.43.32; Tue, 24 Dec 2019 03:43:42 -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 S1726985AbfLXLms (ORCPT + 99 others); Tue, 24 Dec 2019 06:42:48 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:49827 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbfLXLms (ORCPT ); Tue, 24 Dec 2019 06:42:48 -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 1iji67-000169-7U; Tue, 24 Dec 2019 12:11:31 +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 22/32] irqchip/gic-v4.1: Plumb set_vcpu_affinity SGI callbacks Date: Tue, 24 Dec 2019 11:10:45 +0000 Message-Id: <20191224111055.11836-23-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 As for VLPIs, there is a number of configuration bits that cannot be directly communicated through the normal irqchip API, and we have to use our good old friend set_vcpu_affinity. This is used to configure group and priority for a given vSGI. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 18 ++++++++++++++++++ include/linux/irqchip/arm-gic-v4.h | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 47d63a5b43ff..5126bdcfe079 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3886,6 +3886,23 @@ static int its_sgi_get_irqchip_state(struct irq_data *d, return 0; } +static int its_sgi_set_vcpu_affinity(struct irq_data *d, void *vcpu_info) +{ + struct its_vpe *vpe = irq_data_get_irq_chip_data(d); + struct its_cmd_info *info = vcpu_info; + + switch (info->cmd_type) { + case PROP_UPDATE_SGI: + vpe->sgi_config[d->hwirq].priority = info->priority; + vpe->sgi_config[d->hwirq].group = info->group; + its_configure_sgi(d, false); + return 0; + + default: + return -EINVAL; + } +} + static struct irq_chip its_sgi_irq_chip = { .name = "GICv4.1-sgi", .irq_mask = its_sgi_mask_irq, @@ -3893,6 +3910,7 @@ static struct irq_chip its_sgi_irq_chip = { .irq_set_affinity = its_sgi_set_affinity, .irq_set_irqchip_state = its_sgi_set_irqchip_state, .irq_get_irqchip_state = its_sgi_get_irqchip_state, + .irq_set_vcpu_affinity = its_sgi_set_vcpu_affinity, }; static int its_sgi_irq_domain_alloc(struct irq_domain *domain, diff --git a/include/linux/irqchip/arm-gic-v4.h b/include/linux/irqchip/arm-gic-v4.h index 30b4855bf766..a1a9d40266f5 100644 --- a/include/linux/irqchip/arm-gic-v4.h +++ b/include/linux/irqchip/arm-gic-v4.h @@ -98,6 +98,7 @@ enum its_vcpu_info_cmd_type { SCHEDULE_VPE, DESCHEDULE_VPE, INVALL_VPE, + PROP_UPDATE_SGI, }; struct its_cmd_info { @@ -110,6 +111,10 @@ struct its_cmd_info { bool g0en; bool g1en; }; + struct { + u8 priority; + bool group; + }; }; }; -- 2.20.1