Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp395372ybx; Fri, 1 Nov 2019 05:18:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCKjvdIBniWamKhQ+MR+wXh1mymc3DGaAZLi8+/7hfpIZR3Et96vlv0tSb8jne5h/eIdit X-Received: by 2002:a50:c408:: with SMTP id v8mr12183720edf.140.1572610688002; Fri, 01 Nov 2019 05:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572610687; cv=none; d=google.com; s=arc-20160816; b=Z/VKRTNuXMnnGahfvYGnhOmG6kHnoICfUjz96y6hogJUX6KYj5urfQCOpGj+auPdWI 8VlsFrM4kRwL7nIBj9jBru0qvLmev2epzDSTgTRfY9wYRtKWnNQ5U08jYRovM7pVNt+G 2pGH4bYbwQFrcUK4Tf1nMebNeSne8SU4IQxJDJOnfLPHtvv5PKbnatIjcVTU/1pd2vZ+ QUfSB/ag7iKIlszgnFy47ytaeFqFaoEMux56s1hfp4qFU+IlUNGhecUrwsH6+6yfbvvw aS0DFg8o8vIpefFt1//lhoTCH793pyAs3sYtY5hjHi1J30qUd7J4LDkahH2uO4z3z6UH vTKA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ExJR0Gss58xx8OC2aXdsPRk/qQPAE0nzyAei5I71bds=; b=lH/EUJwL9VujbvjOXcKb8PZg4SVh2rgxWHj9q5iyXYHT/tf5R1No9d+0vPc5PbMHxY lKCW2jvZXU9gSbGxzdo6WAKcHrPh6gPq7YhnSGxcqbQVreHOc0mU8NCHpAfue29Ap53D MrMoj3vWY4ljT9TOtbVs2hDRlo5oa400HBW6UQtF0nzPtF6dqbvmUboQGm0bCZe/OpqZ 3JOCckb30ABsLjttk8dnfSejvg5TH64BC/IgDJP48kjd5RXHNJkXhcxWkYt0tGuwSINf BQ8pjJ1W5bTrDa/t3V0GIQS4/lFtaIoXP5jU16upzvJda72lpwLpCbTp0hesjk79wPOI G10A== 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 t17si239030edc.426.2019.11.01.05.17.44; Fri, 01 Nov 2019 05:18:07 -0700 (PDT) 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 S1728277AbfKALGK (ORCPT + 99 others); Fri, 1 Nov 2019 07:06:10 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5680 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726720AbfKALGK (ORCPT ); Fri, 1 Nov 2019 07:06:10 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BE556712A63643A18BCD; Fri, 1 Nov 2019 19:06:07 +0800 (CST) Received: from [127.0.0.1] (10.173.222.27) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Fri, 1 Nov 2019 19:05:57 +0800 Subject: Re: [PATCH v2 13/36] irqchip/gic-v4.1: Don't use the VPE proxy if RVPEID is set To: Marc Zyngier , , CC: Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose , Thomas Gleixner , Jason Cooper , Lorenzo Pieralisi , "Andrew Murray" , Jayachandran C , "Robert Richter" References: <20191027144234.8395-1-maz@kernel.org> <20191027144234.8395-14-maz@kernel.org> From: Zenghui Yu Message-ID: <8514ccbe-814a-5bdd-3791-bdd65510ce68@huawei.com> Date: Fri, 1 Nov 2019 19:05:56 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20191027144234.8395-14-maz@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Hi Marc, On 2019/10/27 22:42, Marc Zyngier wrote: > The infamous VPE proxy device isn't used with GICv4.1 because: > - we can invalidate any LPI from the DirectLPI MMIO interface > - the ITS and redistributors understand the life cycle of > the doorbell, so we don't need to enable/disable it all > the time > > So let's escape early from the proxy related functions. > > Signed-off-by: Marc Zyngier Reviewed-by: Zenghui Yu > --- > drivers/irqchip/irq-gic-v3-its.c | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index 220d490d516e..999e61a9b2c3 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3069,7 +3069,7 @@ static const struct irq_domain_ops its_domain_ops = { > /* > * This is insane. > * > - * If a GICv4 doesn't implement Direct LPIs (which is extremely > + * If a GICv4.0 doesn't implement Direct LPIs (which is extremely > * likely), the only way to perform an invalidate is to use a fake > * device to issue an INV command, implying that the LPI has first > * been mapped to some event on that device. Since this is not exactly > @@ -3077,9 +3077,18 @@ static const struct irq_domain_ops its_domain_ops = { > * only issue an UNMAP if we're short on available slots. > * > * Broken by design(tm). > + * > + * GICv4.1 actually mandates that we're able to invalidate by writing to a > + * MMIO register. It doesn't implement the whole of DirectLPI, but that's > + * good enough. And most of the time, we don't even have to invalidate > + * anything, so that's actually pretty good! I can't understand the meaning of this last sentence. May I ask for an explanation? :) Thanks, Zenghui > */ > static void its_vpe_db_proxy_unmap_locked(struct its_vpe *vpe) > { > + /* GICv4.1 doesn't use a proxy, so nothing to do here */ > + if (gic_rdists->has_rvpeid) > + return; > + > /* Already unmapped? */ > if (vpe->vpe_proxy_event == -1) > return; > @@ -3102,6 +3111,10 @@ static void its_vpe_db_proxy_unmap_locked(struct its_vpe *vpe) > > static void its_vpe_db_proxy_unmap(struct its_vpe *vpe) > { > + /* GICv4.1 doesn't use a proxy, so nothing to do here */ > + if (gic_rdists->has_rvpeid) > + return; > + > if (!gic_rdists->has_direct_lpi) { > unsigned long flags; > > @@ -3113,6 +3126,10 @@ static void its_vpe_db_proxy_unmap(struct its_vpe *vpe) > > static void its_vpe_db_proxy_map_locked(struct its_vpe *vpe) > { > + /* GICv4.1 doesn't use a proxy, so nothing to do here */ > + if (gic_rdists->has_rvpeid) > + return; > + > /* Already mapped? */ > if (vpe->vpe_proxy_event != -1) > return; > @@ -3135,6 +3152,10 @@ static void its_vpe_db_proxy_move(struct its_vpe *vpe, int from, int to) > unsigned long flags; > struct its_collection *target_col; > > + /* GICv4.1 doesn't use a proxy, so nothing to do here */ > + if (gic_rdists->has_rvpeid) > + return; > + > if (gic_rdists->has_direct_lpi) { > void __iomem *rdbase; > >