From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7E98C3F2D2 for ; Mon, 2 Mar 2020 12:12:54 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 6C8102187F for ; Mon, 2 Mar 2020 12:12:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="dzgfqg0/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C8102187F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1690D4AF63; Mon, 2 Mar 2020 07:12:54 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wAwOlVaXnkST; Mon, 2 Mar 2020 07:12:52 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3D8144AF8A; Mon, 2 Mar 2020 07:12:52 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A61CF4AF8A for ; Mon, 2 Mar 2020 07:12:50 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id flE2ozSxiOT0 for ; Mon, 2 Mar 2020 07:12:49 -0500 (EST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id B698C4AF82 for ; Mon, 2 Mar 2020 07:12:49 -0500 (EST) 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 9AD112173E; Mon, 2 Mar 2020 12:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583151168; bh=Lymq4yucP910jG3yAZt3+nbi5KerTQ3U6G6bpUjy4to=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dzgfqg0/uVS23vSco9JoTIf3WbWIp+BhFrKQRBlscAYzmJYe1JdXz3LW0em6JDra0 tHlUlPG/PDhJIX9GqwoQxKCaqE0RTbt1LDJzflgr3/znEysTywuYph/kfJ5dwTwg0Y onrCNZAOCAvxq/Pfy0xNMTkNhDf65AnnCIt5R2bQ= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j8jwE-009N9H-TY; Mon, 02 Mar 2020 12:12:47 +0000 MIME-Version: 1.0 Date: Mon, 02 Mar 2020 12:12:46 +0000 From: Marc Zyngier To: Zenghui Yu Subject: Re: [PATCH] irqchip/gic-v4.1: Wait for completion of redistributor's INVALL operation In-Reply-To: <20200302092145.899-1-yuzenghui@huawei.com> References: <20200302092145.899-1-yuzenghui@huawei.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.10 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, tglx@linutronix.de, jason@lakedaemon.net, wanghaibin.wang@huawei.com, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: jason@lakedaemon.net, linux-kernel@vger.kernel.org, tglx@linutronix.de, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On 2020-03-02 09:21, Zenghui Yu wrote: > In GICv4.1, we emulate a guest-issued INVALL command by a direct write > to GICR_INVALLR. Before we finish the emulation and go back to guest, > let's make sure the physical invalidate operation is actually completed > and no stale data will be left in redistributor. Per the specification, > this can be achieved by polling the GICR_SYNCR.Busy bit (to zero). > > Signed-off-by: Zenghui Yu > --- > drivers/irqchip/irq-gic-v3-its.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c > b/drivers/irqchip/irq-gic-v3-its.c > index 83b1186ffcad..fc8c2970cee4 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3784,6 +3784,8 @@ static void its_vpe_4_1_invall(struct its_vpe > *vpe) > /* 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); > + > + wait_for_syncr(rdbase); > } > > static int its_vpe_4_1_set_vcpu_affinity(struct irq_data *d, void > *vcpu_info) Yup, well spotted. I'll add that to the series. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD170C3F2D1 for ; Mon, 2 Mar 2020 12:12:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F9E92468D for ; Mon, 2 Mar 2020 12:12:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nCUIC2/o"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="dzgfqg0/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F9E92468D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wpIm1wHMXbTLuLWMjqSo30FzU+n+Lur2iT8rdzEOYnM=; b=nCUIC2/opmX5JwZPw/eG9EHAV Ovse/PzvYS2gzHIIqYwbfKB3NDcotzxA+TLK7wXZtjJOzA9AdKIGnIQzngtYZzoJvxi6iXrUFov9R WixYZdglA0euMz/qFfAlVTeVjQNrt2tFGskdaeQXBCPvmEGPw1JMr4vXjIR3/mSW5QFNL1ApUS3/X Jc45NMx5D1THZ8Ys7yVCdRWb8zZ+wmQbSVN9gn5V0/CyT3BHtwSh841v/EDPWAbqNxztlZe+fPra2 oMnqGUurIE8y8SpZFOAvfRTGCsO1DcRLndzZ4CX7J38UVtbeMrphBQH2jijiI4LmketRbjI8P6tz7 psno5mxJw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8jwJ-0002n6-6B; Mon, 02 Mar 2020 12:12:51 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8jwH-0002mZ-1y for linux-arm-kernel@lists.infradead.org; Mon, 02 Mar 2020 12:12:50 +0000 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 9AD112173E; Mon, 2 Mar 2020 12:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583151168; bh=Lymq4yucP910jG3yAZt3+nbi5KerTQ3U6G6bpUjy4to=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dzgfqg0/uVS23vSco9JoTIf3WbWIp+BhFrKQRBlscAYzmJYe1JdXz3LW0em6JDra0 tHlUlPG/PDhJIX9GqwoQxKCaqE0RTbt1LDJzflgr3/znEysTywuYph/kfJ5dwTwg0Y onrCNZAOCAvxq/Pfy0xNMTkNhDf65AnnCIt5R2bQ= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j8jwE-009N9H-TY; Mon, 02 Mar 2020 12:12:47 +0000 MIME-Version: 1.0 Date: Mon, 02 Mar 2020 12:12:46 +0000 From: Marc Zyngier To: Zenghui Yu Subject: Re: [PATCH] irqchip/gic-v4.1: Wait for completion of redistributor's INVALL operation In-Reply-To: <20200302092145.899-1-yuzenghui@huawei.com> References: <20200302092145.899-1-yuzenghui@huawei.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.10 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, tglx@linutronix.de, jason@lakedaemon.net, wanghaibin.wang@huawei.com, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200302_041249_123097_F1FDC14B X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jason@lakedaemon.net, linux-kernel@vger.kernel.org, wanghaibin.wang@huawei.com, tglx@linutronix.de, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-03-02 09:21, Zenghui Yu wrote: > In GICv4.1, we emulate a guest-issued INVALL command by a direct write > to GICR_INVALLR. Before we finish the emulation and go back to guest, > let's make sure the physical invalidate operation is actually completed > and no stale data will be left in redistributor. Per the specification, > this can be achieved by polling the GICR_SYNCR.Busy bit (to zero). > > Signed-off-by: Zenghui Yu > --- > drivers/irqchip/irq-gic-v3-its.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c > b/drivers/irqchip/irq-gic-v3-its.c > index 83b1186ffcad..fc8c2970cee4 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3784,6 +3784,8 @@ static void its_vpe_4_1_invall(struct its_vpe > *vpe) > /* 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); > + > + wait_for_syncr(rdbase); > } > > static int its_vpe_4_1_set_vcpu_affinity(struct irq_data *d, void > *vcpu_info) Yup, well spotted. I'll add that to the series. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3049C3F2D2 for ; Mon, 2 Mar 2020 12:12:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9FA32187F for ; Mon, 2 Mar 2020 12:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583151170; bh=Lymq4yucP910jG3yAZt3+nbi5KerTQ3U6G6bpUjy4to=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=zvV4nj7d5uR7fO2RpqT0owakJDizZc9HVD5E6Y3yVpWLPRX+Rm6bpAqPzsEBT5BrK 8v8pb0JLXX0RqnMHSPBN6HD3E9DRs52EvYbUYfnWVn98QP+4ocHsC1TO1yHlCSaoZH ivdEOApCvZfqqLpyXetv4qzTe68L0QPo1cAsigKo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727519AbgCBMMt (ORCPT ); Mon, 2 Mar 2020 07:12:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:60450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbgCBMMt (ORCPT ); Mon, 2 Mar 2020 07:12:49 -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 9AD112173E; Mon, 2 Mar 2020 12:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583151168; bh=Lymq4yucP910jG3yAZt3+nbi5KerTQ3U6G6bpUjy4to=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dzgfqg0/uVS23vSco9JoTIf3WbWIp+BhFrKQRBlscAYzmJYe1JdXz3LW0em6JDra0 tHlUlPG/PDhJIX9GqwoQxKCaqE0RTbt1LDJzflgr3/znEysTywuYph/kfJ5dwTwg0Y onrCNZAOCAvxq/Pfy0xNMTkNhDf65AnnCIt5R2bQ= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j8jwE-009N9H-TY; Mon, 02 Mar 2020 12:12:47 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 02 Mar 2020 12:12:46 +0000 From: Marc Zyngier To: Zenghui Yu Cc: linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, tglx@linutronix.de, jason@lakedaemon.net, wanghaibin.wang@huawei.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] irqchip/gic-v4.1: Wait for completion of redistributor's INVALL operation In-Reply-To: <20200302092145.899-1-yuzenghui@huawei.com> References: <20200302092145.899-1-yuzenghui@huawei.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.10 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, tglx@linutronix.de, jason@lakedaemon.net, wanghaibin.wang@huawei.com, linux-arm-kernel@lists.infradead.org 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 On 2020-03-02 09:21, Zenghui Yu wrote: > In GICv4.1, we emulate a guest-issued INVALL command by a direct write > to GICR_INVALLR. Before we finish the emulation and go back to guest, > let's make sure the physical invalidate operation is actually completed > and no stale data will be left in redistributor. Per the specification, > this can be achieved by polling the GICR_SYNCR.Busy bit (to zero). > > Signed-off-by: Zenghui Yu > --- > drivers/irqchip/irq-gic-v3-its.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c > b/drivers/irqchip/irq-gic-v3-its.c > index 83b1186ffcad..fc8c2970cee4 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3784,6 +3784,8 @@ static void its_vpe_4_1_invall(struct its_vpe > *vpe) > /* 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); > + > + wait_for_syncr(rdbase); > } > > static int its_vpe_4_1_set_vcpu_affinity(struct irq_data *d, void > *vcpu_info) Yup, well spotted. I'll add that to the series. Thanks, M. -- Jazz is not dead. It just smells funny...