Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4882126ybf; Wed, 4 Mar 2020 12:37:00 -0800 (PST) X-Google-Smtp-Source: ADFU+vtxdvYHQWqFpjK5RM5tvGOQnet9Vfq9PIqYPARpSfqy9ACccY/dgJIIVdZXCGcy+U82kMc2 X-Received: by 2002:aca:2419:: with SMTP id n25mr3105938oic.13.1583354220651; Wed, 04 Mar 2020 12:37:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583354220; cv=none; d=google.com; s=arc-20160816; b=g3ZmtA8VH4w2449MC3FRa+HltskC4ZZROhc/c5XCb4x7O8JysNU2R/2SIoiFgaP6ON 6suQ0NzsvColonegcvdtIP5yY9RTx28oOd2ym2p6W7QlRgaDNHV6ejvcz4y6GBB3aoSm dIYUwt6BCpHK1366MBNHyvaHvnS/cXN1b2JultSL2NOQH3T44V8a0oOISKqM13+3++Qh NMgERfBZ1vog1ZVgq1Q6yGERgHgmLxCrSIXUGf09PQK1jXZFrbqXsNqvdhgL3tdbErlp ME0BycTY5wsmDAHHTnhiyDCQOLmwrZOv5LQxrFfVKdWa0xqJa8cqJa4rUlGCFlqaPJAV 0AAw== 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=t59lv+rkqGCmcpV7z3JayQalCx+8TRWIlXj91FeoSSI=; b=io3Cs9HQBXqS4cyHv4wxSenQg15gNoOlN79mnKEO6/nTktMT/DeF9MtZU7OeSiRj6C /YfW0Cv6DbjJ8mYcE3bJAkLfR2RseTF1y3SZbHPIgMk1BBUOrAQ+l3y2KKE6S5mU5YgV gE/Qkr6iMNUj8YXGSD0s0REwT9yL/BfS9hTurU37AFck46T/xA0/D9Ymnq5kq0zMHkmq z/Wcix17mxOietc3agobu8tni58dcxg6VT2FNLZ15Bg/eUEePqwUh91N+wCCBTNRFbMA JQ5GrOPuanhMD2D9VU4vkVDlia1uaIlg1jXIwB0WTfsZM5R2aWrSHB3WNhHBz85JUi89 LqzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KBrFBmZM; 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 d7si2027959ote.131.2020.03.04.12.36.49; Wed, 04 Mar 2020 12:37:00 -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=KBrFBmZM; 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 S2388360AbgCDUgb (ORCPT + 99 others); Wed, 4 Mar 2020 15:36:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:36306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388328AbgCDUga (ORCPT ); Wed, 4 Mar 2020 15:36:30 -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 4AD7721775; Wed, 4 Mar 2020 20:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583354189; bh=jIaDVMgNDAojAdth6JddZsvPCm/9yhXe9ZoXPpkkiXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBrFBmZMnU6th+KyvGB6vi0fv+RN1kGbLj/ljvPLgOxKiEiab14eVbvQdFjZTRELB KwLOOl70rlLXY7X9ydLYIt+OeGYFlP8GufgvQtoKLB9ukuVJd99Vx4JcneHjtDQJ6s my82YXb2aA/0ptwsc14rmDw/KhE/74jEcxHxN5Cg= 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 1j9aj9-00A59R-9H; Wed, 04 Mar 2020 20:34:47 +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 12/23] irqchip/gic-v4.1: Plumb set_vcpu_affinity SGI callbacks Date: Wed, 4 Mar 2020 20:33:19 +0000 Message-Id: <20200304203330.4967-13-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 Just like for vLPIs, there is some configuration information that cannot be directly communicated through the normal irqchip API, and we have to use our good old friend set_vcpu_affinity as a side-band communication mechanism. This is used to configure group and priority for a given vSGI. Signed-off-by: Marc Zyngier Reviewed-by: Zenghui Yu --- 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 fb2b836c31ff..effb0e0b0c9d 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4033,6 +4033,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, @@ -4040,6 +4057,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 44e8c19e3d56..b4dbf899460b 100644 --- a/include/linux/irqchip/arm-gic-v4.h +++ b/include/linux/irqchip/arm-gic-v4.h @@ -103,6 +103,7 @@ enum its_vcpu_info_cmd_type { SCHEDULE_VPE, DESCHEDULE_VPE, INVALL_VPE, + PROP_UPDATE_SGI, }; struct its_cmd_info { @@ -115,6 +116,10 @@ struct its_cmd_info { bool g0en; bool g1en; }; + struct { + u8 priority; + bool group; + }; }; }; -- 2.20.1