Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1432251ybl; Wed, 18 Dec 2019 19:06:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyFVoW4A2d6BKVlzVRYtUT68a3V2pG7I13qYZDaBIiKX5mzAeQeeZ9EfsqFZ/5SNwmypAs2 X-Received: by 2002:a9d:7b50:: with SMTP id f16mr6466921oto.18.1576724796502; Wed, 18 Dec 2019 19:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576724796; cv=none; d=google.com; s=arc-20160816; b=A/vSL2orhWeQcz9LMdJXjMPlp8BANOU0BgYn/05SVFnibazCsY2XNoAynmdauNjXgn MiPKRcl7ECIpdxkK0heiGFB8lgdqYkTEZ5LJsLPVrRLH2bYa2WjuvHziFJ1xyH4HQObN 6Td7+2WzxEHSxavPpuV6wnVRLzc+RlrHa07P8UPNoA0lOK2+/aBANiqJSc7+qiTgb+A2 Sf6dwwB+BINhDro2hTIxvLQzY8VFj+sMKilLjKtJyUyJHOHJ2rOEcBaJCLNMvMl6sfgX Nv2dwhUr4vbmcxCHlcbB/SY6QdIuEwYxJs0MpwP8zSxvQ21h/okNHXq4cbTXdAIwyoJd /TCQ== 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=E5oKRCRBbkFSCdNERrdEIthVsdoNz2RmhXIIPKS70ck=; b=iqU0TCFuhfBN5vr35y/S0DGK8lOjM/4ZAWGd3S4skI5b7SFlv7ITZegbC8XfKcuPgk X+UEEUdF4n5Q8Dzwe6fy9FYzzv/hSPp2JlrsXxHqs58Ml2mYq9NvTlPkqWtRLkVX9gkg QGrKyt+fqok4DAkeJd6FK0aMj4s6sqNYsjf7GyCMSyrTnL11KmAd3bm81brkJ5KHocMI 6G2TWDI4t4J/E+laUT0z4W3X2PFjv6RiAf9edmBIU5BPF6NJFOWQ6w15CXC/rZnVUwlI V7uefmh/r3/AeZmvw3IQ6h7VqTAMF9kWvpWD10ByiUuOR/qt2NaI3iV5KCpVHPE8+hXK gIBg== 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 m8si2329548oim.180.2019.12.18.19.06.25; Wed, 18 Dec 2019 19:06: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; 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 S1726891AbfLSDF0 (ORCPT + 99 others); Wed, 18 Dec 2019 22:05:26 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8148 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726463AbfLSDFZ (ORCPT ); Wed, 18 Dec 2019 22:05:25 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B8CCE53371AB78EB18E1; Thu, 19 Dec 2019 11:05:23 +0800 (CST) Received: from [127.0.0.1] (10.173.222.27) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Thu, 19 Dec 2019 11:05:11 +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> <8514ccbe-814a-5bdd-3791-bdd65510ce68@huawei.com> <762f78e917ac501629729fcf7718178c@www.loen.fr> From: Zenghui Yu Message-ID: Date: Thu, 19 Dec 2019 11:05:09 +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: <762f78e917ac501629729fcf7718178c@www.loen.fr> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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/12/18 22:39, Marc Zyngier wrote: > On 2019-11-01 11:05, Zenghui Yu wrote: >> 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? :) > > Yeah, reading this now, it feels pretty clumsy, and only remotely > connected to the patch. > > What I'm trying to say here is that, although GICv4.1 doesn't have > the full spectrum of v4.0 DirectLPI (it only allows a subset of it), > this subset is more then enough for us. Here's the rational: > > When a vPE exits from the hypervisor, we know whether we need to > request a doorbell or not (depending on whether we're blocking on > WFI or not). On GICv4.0, this translates into enabling the doorbell > interrupt, which generates an invalidation (costly). And whenever > we've taken a doorbell, or are scheduled again, we need to turn > the doorbell off (invalidation again). > > With v4.1, we can just say *at exit time* whether we want doorbells > to be subsequently generated (see its_vpe_4_1_deschedule() and the > req_db parameter in the info structure). This is part of making > the vPE non-resident, so we have 0 overhead at this stage. Great, and get it. Thanks for this clear explanation! Zenghui