Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3184873pxf; Sun, 21 Mar 2021 23:04:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOCPfzDwr0gkk9ZI/gpwZaH7HxWyftXQGbBErRbWB39fac2e4+BZgfKqSjlmAIIl/lMVBN X-Received: by 2002:a50:ec96:: with SMTP id e22mr23886097edr.385.1616393090456; Sun, 21 Mar 2021 23:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616393090; cv=none; d=google.com; s=arc-20160816; b=ub6AhpFpZWiEQh7DmV64W9pk3YSNLVfYXK7nYqQGhp2Re24CsSGfHIr8F+eRX8Hkqi GXVYVZ7tnm4/6wDxpxwrtiwvlanzTpQgb3clLyj59XP2n2wLiQJDpmrT+FuMhtVMswAQ cF/wf9Xv+nOmGDf6lXgpOmQxoflb6qFttM4r3tdZzSXum7K6ExuFrjaa05X9undID1Ul J5Belky+p+75esgZPcybxeo/H0nefpWwQHCv3iBwTYQB+PCuCa7RXTJXtAUZVZ35xvzl KSGOl5GATF72QvtCMTZLILBnCDYuWSkqm++sqKhe+qLb68CyFAP6WEuWgFpzf0KqCKkk Naag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=m9H2muUMBIJ7lWAyXrHcr2MswVF8dRjOPwtah4bkQEc=; b=fXchoXPtwUQi+tyKYDH8KjVM6IPDvrlfG7N7V923idVgcsaBrhfx3evSpxt+u/uup9 pPr4X+bo8zGq3pDYap1eOlpc3xiahFkA6m/9mkj2wcAQHr3kEnQ3coM4TwK/AC82Mfpl 6N/DgaCmM6LqCkKZbAa6BuEGLuiO6kEk6ZIrlQMICqAHwBY5JYnAVABmL1r8rGyL4vT2 zhrpB5weWQS1EVpjTrfb7l6hNcAAwKnYh3IIh++VyIe7HDKJWGA2Zt+bmT7ZFKCiO2Lk gUUNenddV5flf0gb2bSFxguYRKYz2AZsuPKp4N8itK3s8nY/69NeqDRziW+ZIICvEcwg hS/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si10358878ejf.199.2021.03.21.23.04.28; Sun, 21 Mar 2021 23:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbhCVGDZ (ORCPT + 99 others); Mon, 22 Mar 2021 02:03:25 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14048 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbhCVGCj (ORCPT ); Mon, 22 Mar 2021 02:02:39 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F3kP42fgxzNq42; Mon, 22 Mar 2021 14:00:08 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.184.135) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Mon, 22 Mar 2021 14:02:27 +0800 From: Shenming Lu To: Marc Zyngier , Eric Auger , "Will Deacon" , , , , CC: Alex Williamson , Cornelia Huck , Lorenzo Pieralisi , , , Subject: [PATCH v5 2/6] irqchip/gic-v3-its: Drop the setting of PTZ altogether Date: Mon, 22 Mar 2021 14:01:54 +0800 Message-ID: <20210322060158.1584-3-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20210322060158.1584-1-lushenming@huawei.com> References: <20210322060158.1584-1-lushenming@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.184.135] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GICv4.1 gives a way to get the VLPI state, which needs to map the vPE first, and after the state read, we may remap the vPE back while the VPT is not empty. So we can't assume that the VPT is empty at the first map. Besides, the optimization of PTZ is probably limited since the HW should be fairly efficient to parse the empty VPT. Let's drop the setting of PTZ altogether. Signed-off-by: Shenming Lu --- drivers/irqchip/irq-gic-v3-its.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 4eb907f65bd0..c8b5a88ac31c 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -794,8 +794,16 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, its_encode_alloc(cmd, alloc); - /* We can only signal PTZ when alloc==1. Why do we have two bits? */ - its_encode_ptz(cmd, alloc); + /* + * We can only signal PTZ when alloc==1. Why do we have two bits? + * GICv4.1 gives a way to get the VLPI state, which needs the vPE + * to be unmapped first, and in this case, we may remap the vPE + * back while the VPT is not empty. So we can't assume that the + * VPT is empty at the first map. Besides, the optimization of PTZ + * is probably limited since the HW should be fairly efficient to + * parse the empty VPT. Let's drop the setting of PTZ altogether. + */ + its_encode_ptz(cmd, false); its_encode_vconf_addr(cmd, vconf_addr); its_encode_vmapp_default_db(cmd, desc->its_vmapp_cmd.vpe->vpe_db_lpi); -- 2.19.1