Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2078241ybf; Mon, 2 Mar 2020 01:23:02 -0800 (PST) X-Google-Smtp-Source: APXvYqw2wLxKLTaKP+vYmkGd3aHnYDMEXNhyKo8fd0OzTxpwV1feI5SxPJB7STMiuA4dv0cLzuUs X-Received: by 2002:a05:6808:218:: with SMTP id l24mr10179697oie.108.1583140982695; Mon, 02 Mar 2020 01:23:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583140982; cv=none; d=google.com; s=arc-20160816; b=IE6Z4vxo0BmzZ7s+rFpnX987LSZvb9U5iFb6vmjEYy3M0hXK0A6U5HkYff4F+yt2Vx QKGvJdAkbxIY7R++vsWhf7x0r3asRU+vhRZcZTakg09lN/fDAhJh9RX7eb2SsQI84dGo HupWNECF0LIVnbERWes4cF2PQM2kwk3nISwoofNtG3uehuAWUln2GyTgU78sDVkfcFKO BpZPL63v0KOqsVPW9/YnisUE2de1KXOuk/e6hG6QKqfEhl/1vAUft56afx7nG3rHJNVz BrO7oNNOMmiMlCkw0SGywTU26ak3RBgc+HXKAFWCWkG/iwT8NuX5Vd8Apbs/TBE3NKas NgZA== 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 :message-id:date:subject:cc:to:from; bh=2S/vEySIjIov/VDS5roOYJBzghTginJRpZDSmRXEVbE=; b=RPqf2g10Pi9duo8xxjizhjjdUewyXq7RBfzE8dSyYGe1PYCafVT1LAej2BTUmBhQ9U cQcw0rC8p59V5p5v0rr0ISUyUl59p6WSI1QygMcL+rBWTXGzvu0bH/eW5iPmsOJJ72eG MCbGUKEONvCD7544nIiORyxSlYq7Yr9BXqOsPMgzPuu62Sq6+X+FbNquPqUIwHdsLlIh +chnpnvE+x/faIDvRNhqsgxGPPQqWiwKDsw1wDaoseEzBDWCWelQRnwXk95IV7Vz9rNN l3efHSDSZPm8ZNpBBUEm3GytTOw/T2Olbp28Wkifqu2b4/aeccxXim0apaVdj9tBS1rx Hqdw== 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 193si5893450oie.51.2020.03.02.01.22.50; Mon, 02 Mar 2020 01:23:02 -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 S1727386AbgCBJWW (ORCPT + 99 others); Mon, 2 Mar 2020 04:22:22 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:37296 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727383AbgCBJWW (ORCPT ); Mon, 2 Mar 2020 04:22:22 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 542D2877FE3F9071A0B5; Mon, 2 Mar 2020 17:22:18 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.173.222.27) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Mon, 2 Mar 2020 17:22:11 +0800 From: Zenghui Yu To: , CC: , , , , , Zenghui Yu Subject: [PATCH] irqchip/gic-v4.1: Wait for completion of redistributor's INVALL operation Date: Mon, 2 Mar 2020 17:21:45 +0800 Message-ID: <20200302092145.899-1-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.173.222.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.19.1