Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp974801ybl; Fri, 24 Jan 2020 13:01:50 -0800 (PST) X-Google-Smtp-Source: APXvYqzlrslCSceZ7D5qTUiN0DXZLdsHaX5GT2Cwgu41TIxnrrHOGhU+6oUTYR7HhZjXwMzCQXNP X-Received: by 2002:a9d:6e82:: with SMTP id a2mr4058287otr.336.1579899710026; Fri, 24 Jan 2020 13:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899710; cv=none; d=google.com; s=arc-20160816; b=HdxGbekpk/8fqi7Nx/LKixxAo+sYTZzT8bjOn0z5SN9BjFhBxSeT6wmGmjB3mgWCcq D/lIQPHbDg+Kn00wf4dimCZeIK03ES/NGol2727AgE0cM6aAp3W4BVoSQUU8mksSth3A a/j58wxFW9zalgJS9I73dKuYRH84jS3Vgh2pS0nTZQxlPtnEHlATiV2CwO5F1TG46mYI 89Q5kQjwXKQtl5sPwonTxU0dr100uylcbtV424KhUInG1X5bbUkyGb1143QboFRNF+sX yiPEkbktiyQZq7SaoDWrADliXsP70FVfvZ1Qnp3jFDz9EXnwfOOUbm+w77hUDrIQmAYD 2Dcw== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=ZvKKfX7leeFOU+JQrM4WWFRnRlpiQxm0s+jn2tubkCM=; b=KY/tPTc/6s+dW3LZ3Qf88HL5cH5v8M4Pj/aAoOXjOHQDnrdVZJnzTLgf9FynIdnIcJ wZq/NDhT0iLMchrat1Z/EXBpSnUUNPwEao0lMKvcRB5BPAQNI5XqvTylxPrvJTs/wh4/ 9hjN0z6V6UBJMtiETGHSdBxv9pCA0u/iTk7Pb75TTF0uqaGGIYDN1oZQLW/IA0mOpJWv n3WuH3HwzSo1JQePoZ2dZ4qhYbufMqzumkPOuqMTXAkJQbn8AlL1qfsJcZrsgm2L7tGv Xz2x3bgquyDFBQ8d/hJctlTv0E/AQiw9IwIOQZdUJ1S9gg4MTCEiAlO8b8fSUcwywQlA fd5w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si336714oij.38.2020.01.24.13.01.38; Fri, 24 Jan 2020 13:01:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392193AbgAXTMu (ORCPT + 99 others); Fri, 24 Jan 2020 14:12:50 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:43007 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391902AbgAXTLP (ORCPT ); Fri, 24 Jan 2020 14:11:15 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iv4MF-0007Zz-P5; Fri, 24 Jan 2020 20:11:07 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id ED8C51C1A61; Fri, 24 Jan 2020 20:11:06 +0100 (CET) Date: Fri, 24 Jan 2020 19:11:06 -0000 From: "tip-bot2 for Marc Zyngier" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/gic-v4.1: Add VPE INVALL callback Cc: Marc Zyngier , Zenghui Yu , x86 , LKML In-Reply-To: <20191224111055.11836-14-maz@kernel.org> References: <20191224111055.11836-14-maz@kernel.org> MIME-Version: 1.0 Message-ID: <157989306677.396.6031131179666666784.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/core branch of tip: Commit-ID: b4a4bd0f2629ec2ece7690de1b4721529da29871 Gitweb: https://git.kernel.org/tip/b4a4bd0f2629ec2ece7690de1b4721529da29871 Author: Marc Zyngier AuthorDate: Tue, 24 Dec 2019 11:10:36 Committer: Marc Zyngier CommitterDate: Wed, 22 Jan 2020 14:22:21 irqchip/gic-v4.1: Add VPE INVALL callback GICv4.1 redistributors have a VPE-aware INVALL register. Progress! We can now emulate a guest-requested INVALL without emiting a VINVALL command. Signed-off-by: Marc Zyngier Reviewed-by: Zenghui Yu Link: https://lore.kernel.org/r/20191224111055.11836-14-maz@kernel.org --- drivers/irqchip/irq-gic-v3-its.c | 14 ++++++++++++++ include/linux/irqchip/arm-gic-v3.h | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 69b16e5..1d8d96a 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3669,6 +3669,19 @@ static void its_vpe_4_1_deschedule(struct its_vpe *vpe, } } +static void its_vpe_4_1_invall(struct its_vpe *vpe) +{ + void __iomem *rdbase; + u64 val; + + val = GICR_INVALLR_V; + val |= FIELD_PREP(GICR_INVALLR_VPEID, vpe->vpe_id); + + /* Target the redistributor this vPE is currently known on */ + rdbase = per_cpu_ptr(gic_rdists->rdist, vpe->col_idx)->rd_base; + gic_write_lpir(val, rdbase + GICR_INVALLR); +} + static int its_vpe_4_1_set_vcpu_affinity(struct irq_data *d, void *vcpu_info) { struct its_vpe *vpe = irq_data_get_irq_chip_data(d); @@ -3684,6 +3697,7 @@ static int its_vpe_4_1_set_vcpu_affinity(struct irq_data *d, void *vcpu_info) return 0; case INVALL_VPE: + its_vpe_4_1_invall(vpe); return 0; default: diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index 822dae6..49ed6fa 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -247,6 +247,12 @@ #define GICR_TYPER_COMMON_LPI_AFF GENMASK_ULL(25, 24) #define GICR_TYPER_AFFINITY GENMASK_ULL(63, 32) +#define GICR_INVLPIR_VPEID GENMASK_ULL(47, 32) +#define GICR_INVLPIR_V GENMASK_ULL(63, 63) + +#define GICR_INVALLR_VPEID GICR_INVLPIR_VPEID +#define GICR_INVALLR_V GICR_INVLPIR_V + #define GIC_V3_REDIST_SIZE 0x20000 #define LPI_PROP_GROUP1 (1 << 1)