Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4881807ybf; Wed, 4 Mar 2020 12:36:36 -0800 (PST) X-Google-Smtp-Source: ADFU+vu71cjwWOyUAOiULgroo2/jO12C4c8FKD94RWPLWbXCyv2fkSfLgAhd0Z5Sns+9gPm5fkBJ X-Received: by 2002:aca:44b:: with SMTP id 72mr3025044oie.67.1583354196723; Wed, 04 Mar 2020 12:36:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583354196; cv=none; d=google.com; s=arc-20160816; b=SaEfMDd3gqlytS6xaxIGYepFGeoghxrIzTmCuYyYWac8iTnYO7QPsNZ+FPz+mSwLKJ fqrwbd7yaog2bJOUk7JntJvKWytxReq0lXeQL4yhGpHX2MrHgjAbZ7nrgxXXCO/lO36/ cYN7PIBdJtm+RlSYt5C1wskbLXnNaDQsyrvcBx9QJsQyx982zeUC+VqclHZOuzgUUO+O eVAGU9BxYrXpw3frwhUOVeYDP7YluzEBlhDksp6e6SkuTFlrBZlQiPHsYmM3VrH+hNFY e+6LzTNr6oiL4w8phvvzylCTwFbV+eXJz+Hm5P8wsXp4H15svbqCObVYtqZafIiWkAnH PZhQ== 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=M7ezqvk3nxoBHx9lYkPI2GAOvuQ+AhQCgkbmCvYnxIY=; b=YSOarmmNyt9GwAEBdGYzkkXLy0YXm1Ogzsb825CeNfmm6oHTVkJLnqz55MLwQj3hWk 1l97HH6P1CGpI7KsdI6AwaF55PKaCl40TesnJ8nQFPXnN5TPeBdaHPNZR0W7GZE18m+V LdcZSW/ybwakEOyMSfozm32YTlGVjRoUiuqclA7HmtBzgsgrFZHZLcJiGZChsw9iSQjz W+d81mDoPABxhtcdjdSBMsyc9v6SCM74Vreag5iuw9k8rdAlFVWMpfPQZY6Jg1yHN8QY 1VyuMGeOLZVPwjvKdETehR9QwQ5j2Yi5oI7/b60OhQgxp4E5TBN01CzhQGkPXZ/9gpv7 YfVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZSc3dUU0; 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 s15si1952471otd.209.2020.03.04.12.36.25; Wed, 04 Mar 2020 12:36:36 -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=ZSc3dUU0; 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 S2388452AbgCDUfM (ORCPT + 99 others); Wed, 4 Mar 2020 15:35:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:34818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388280AbgCDUem (ORCPT ); Wed, 4 Mar 2020 15:34:42 -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 5D57424654; Wed, 4 Mar 2020 20:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583354082; bh=eM2bdHK9tkPqOHBhhFZJA4RYlbZPHuULIL3M97M75UI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZSc3dUU0C+X1yJpOrZGVIzRVMlp/VLNlg41C0G7C3nOZeQsUNeX2J51AhdipCjQv2 EWS5mw+G9XpFOJNHgomwgLY9BTF4P3D9cJdDmeXdZIht8mV1dcX+nS9jNxKUQGMXpy R2LrsWfVWEkX+FpvgVTq3P4cHB2aNnmEoz39FAtQ= 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 1j9aj2-00A59R-KN; Wed, 04 Mar 2020 20:34:40 +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 04/23] irqchip/gic-v4.1: Wait for completion of redistributor's INVALL operation Date: Wed, 4 Mar 2020 20:33:11 +0000 Message-Id: <20200304203330.4967-5-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 From: Zenghui Yu 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 Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200302092145.899-1-yuzenghui@huawei.com --- 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 1af713990123..c84370245bea 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3827,6 +3827,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.20.1