Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7469685ybl; Tue, 24 Dec 2019 03:12:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyiZn4qKbNseLL9V0K2buW2YXN1cti+JiU0s3DEY3imcq1wDdQuhSo4q2brOPJL1grVeCMY X-Received: by 2002:a9d:60c4:: with SMTP id b4mr14052267otk.166.1577185959566; Tue, 24 Dec 2019 03:12:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577185959; cv=none; d=google.com; s=arc-20160816; b=joc8SROFy+qrf/rW3aDT1nf60gDiayV+JPwQ/2i3uuwMCcI2RQTchjfe2VPJ2gPoJv EDUVMVKKGob2D0bjsiWOu0R1TTFDkD/9z1Yre2oM9A8yhOyIiy2HwWdRUO0GIuH9qu9t EanAu7HeFun3pTQI3ef44cAe0M7NMGZnJZJCUV9u8XBjxKnhZ0z49621FIKrgLJpON4h Zut4BYbQRZmil35JFtoxQoxjvTkDPW1PLaJompkgqBY2isN/GB24pqVDfe2UFDIDdvBf 37moazIAi/zdyd8ho//WlzfkmithbbViRW7AGPM8zGIKLdAfOm29YYtF0/WZ0ss9vgqJ JDMQ== 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=9wA4EeASlXh9tUOeAgsTAUSzfAR8jmOAqvca349s2wo=; b=XjMBAIyz/HGMubhPOTKlaQoEzIWibR1XhDB8nM9kL2Dw62fEv+DmlAak6eIQ22wxGF fm0DlJ4iU++3CSi3bcE6juyiJocab5VTxCCn9WvpagDKB024Fm+dZKyt4WgJiyt+/MyE I5xrz9aMb86ttLBdqhPxmvsaXgk1953UcqU6bsyfvfeFS1rwmvIJFQA+iz3ppbaRrYfN gydtpuCb4EQHpOI3kelh+mikLR0d5Mv00XNsyDwBc4ZSr6X0/fwe7tVaSR6ctnxXL1ta A6PGzRjTKudRZqy0MgVPw5FqGxk0u7lhXFpMBOUtmqBHhyyJWlcB+ZLfWQ3keP31m37b Nu6w== 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 c7si9187124otr.308.2019.12.24.03.12.27; Tue, 24 Dec 2019 03:12:39 -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 S1727040AbfLXLLc (ORCPT + 99 others); Tue, 24 Dec 2019 06:11:32 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:37640 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbfLXLLS (ORCPT ); Tue, 24 Dec 2019 06:11:18 -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 1iji5t-000169-6L; Tue, 24 Dec 2019 12:11:17 +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 09/32] irqchip/gic-v4.1: Plumb skeletal VPE irqchip Date: Tue, 24 Dec 2019 11:10:32 +0000 Message-Id: <20191224111055.11836-10-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 Just like for GICv4.0, each VPE has its own doorbell interrupt, and thus an irqchip that manages them. Since the doorbell management is quite different on GICv4.1, let's introduce an almost empty irqchip the will get populated over the next new patches. Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index fd9d3b6bb465..157f51398850 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3554,6 +3554,32 @@ static struct irq_chip its_vpe_irq_chip = { .irq_set_vcpu_affinity = its_vpe_set_vcpu_affinity, }; +static int its_vpe_4_1_set_vcpu_affinity(struct irq_data *d, void *vcpu_info) +{ + struct its_cmd_info *info = vcpu_info; + + switch (info->cmd_type) { + case SCHEDULE_VPE: + return 0; + + case DESCHEDULE_VPE: + return 0; + + case INVALL_VPE: + return 0; + + default: + return -EINVAL; + } +} + +static struct irq_chip its_vpe_4_1_irq_chip = { + .name = "GICv4.1-vpe", + .irq_eoi = irq_chip_eoi_parent, + .irq_set_affinity = its_vpe_set_affinity, + .irq_set_vcpu_affinity = its_vpe_4_1_set_vcpu_affinity, +}; + static int its_vpe_id_alloc(void) { return ida_simple_get(&its_vpeid_ida, 0, ITS_MAX_VPEID, GFP_KERNEL); @@ -3634,6 +3660,7 @@ static void its_vpe_irq_domain_free(struct irq_domain *domain, static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, unsigned int nr_irqs, void *args) { + struct irq_chip *irqchip = &its_vpe_irq_chip; struct its_vm *vm = args; unsigned long *bitmap; struct page *vprop_page; @@ -3661,6 +3688,9 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq vm->nr_db_lpis = nr_ids; vm->vprop_page = vprop_page; + if (gic_rdists->has_rvpeid) + irqchip = &its_vpe_4_1_irq_chip; + for (i = 0; i < nr_irqs; i++) { vm->vpes[i]->vpe_db_lpi = base + i; err = its_vpe_init(vm->vpes[i]); @@ -3671,7 +3701,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq if (err) break; irq_domain_set_hwirq_and_chip(domain, virq + i, i, - &its_vpe_irq_chip, vm->vpes[i]); + irqchip, vm->vpes[i]); set_bit(i, bitmap); } -- 2.20.1