Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1893275pxf; Sat, 13 Mar 2021 00:44:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYeRV04kDgaGXo1LeWntj1GUgHIrVBRlyZ3CFji2sZxmtDJ69IGYOYxHT8VXxK5QWePvGI X-Received: by 2002:a17:906:b316:: with SMTP id n22mr12561949ejz.249.1615625073269; Sat, 13 Mar 2021 00:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615625073; cv=none; d=google.com; s=arc-20160816; b=bHY8GTP6U2jvvUvyp4alcIm7m/u2msaQ386R85Y9qq6S9kAINK1Qe0/zNCOlILBID/ mtzFafwDS3ldy07kbCyQc4FFhcqim45f9DqIuja0lXxY4UZPC5yMj0E9W/TfJTDFaqhz YiDN7WKJ0ILVfAoX42jOPUtVH5RjdD3jJUajjWh6V8LyAUIeXmR3VLfxNPhkv6+IeQxx O/IxXXvEA06ujknaU79bV18hzywmihYN7CGCHoCnzWLGB9YPh4w/I6F200qDGn9Iw9IF quEBu899khf9/vnPUUUvXRrpihzyBxHripuOzW1rqz1a9WNn/HhoTWvuOO6M5kuZvvz9 6tyQ== 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=KiI33xTtSEsC+EtOhOyiuLclARtJKZolFrFpimuNJUbJQcdpiu2p7OiQG+dTpnqo88 w96Ao1DzmNm4EWaVXL53zMNCAdQmzBE+8xqUSKx/Nnhpi4C3/exCySLXEW95+6Phe7jR eqMv6lm5oWdFhVmg/3o/e/gT8r7IxrpV/pMnFENHgmhMYkDYI0kgtQlqErZaeJlFhAfs FLddoVqyvmIMOjuuGB050Axsi1dRiFqIWl3/m8jDWUlrqC7kqT4Rj6r6kAlIpbC20/fu PQO+gEZqbYxaBO9kpaH81Az2GeRcfzGUUjQUQXSQ/GJXM16v7nPgOqDWyjChPq7QlMn8 PYyQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si5447389ejo.624.2021.03.13.00.44.10; Sat, 13 Mar 2021 00:44:33 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233369AbhCMIkB (ORCPT + 99 others); Sat, 13 Mar 2021 03:40:01 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13600 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233110AbhCMIjw (ORCPT ); Sat, 13 Mar 2021 03:39:52 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DyGKM5fQYz17KRS; Sat, 13 Mar 2021 16:37:59 +0800 (CST) Received: from DESKTOP-7FEPK9S.china.huawei.com (10.174.184.135) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Sat, 13 Mar 2021 16:39:41 +0800 From: Shenming Lu To: Marc Zyngier , Eric Auger , "Will Deacon" , , , , CC: Alex Williamson , Cornelia Huck , Lorenzo Pieralisi , , , Subject: [PATCH v4 2/6] irqchip/gic-v3-its: Drop the setting of PTZ altogether Date: Sat, 13 Mar 2021 16:38:56 +0800 Message-ID: <20210313083900.234-3-lushenming@huawei.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20210313083900.234-1-lushenming@huawei.com> References: <20210313083900.234-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