Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp723332yba; Thu, 9 May 2019 05:07:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFzLWlwH1g9FBT+rz1GKCCS1g4W0ftat9WySM9/VlvfIGspUMjhBN9CjvZ/hzyJD08bU3H X-Received: by 2002:a63:161d:: with SMTP id w29mr4925303pgl.395.1557403664615; Thu, 09 May 2019 05:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557403664; cv=none; d=google.com; s=arc-20160816; b=OrPMe2W8vmpP1um8QRfC+ePOcUrD2TRQqWt/n9/8e4SUIw5Fl/hRnlnlxSRGKLlDIV Jb4RHCf5l8m8jcqxe513DqlOyMAOM3WW1eClTmoTL7QZ94Enz4cxuq3Q57v1rUAspw0E n/8BpCBVA45rtvnoQsQv+zDjW2eelLhXyyVffaL//EyhLAuRSpD8bjWgRAExFmRikaH9 PPaAp40fa36s1PJ8t59l6f93S1kQFWbb4xJ+BoJzatEFqceFW5s/4QeSRP7zvN1d1iRC 0GsWL9lqD9YiR/1A2nMyqqfC0Kb0Jz6r9bhqoxTpQgpvhGwQT2ghjmwG4dKJtGcb/osD MFUA== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=A4OPiFAZimySHpQsCdKdCHiIVvFtZuead8Ob2EYCBuA=; b=U+KZsKRxLKz117w9/JkKNREOS+WgTtTfiZVbfepiXm0PhQN+5eI8nWuiZpv1SYnh3d 57iJMDXSYNQAzJV0udfEWrD7lZgCXKVKa0pNbQOleuByBjWi7wrgf64D1XhXh5y+ZdRO eWJ/cebWJm74W4jdHsNSVb2aKx4XeyWFZvlZow3YDyHFWJ27J5iO6lJ3QbMlMy3GWyXw YeexqmUCBWtQmsrYfaXqDlPIPXvV8DN59tEGWmAUad4Vab91XM7iIFWt3h0Mw9Qh/Px0 qWDVXqxqdTpV1J9/tvyU0+ZOKJdxzP/SGzE+5gbcc0PGkPTop5EFI3weiTFGuRjmZc1Y tvkA== 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 d186si2652343pgc.311.2019.05.09.05.07.28; Thu, 09 May 2019 05:07:44 -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 S1726583AbfEIMFR (ORCPT + 99 others); Thu, 9 May 2019 08:05:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7184 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725961AbfEIMFQ (ORCPT ); Thu, 9 May 2019 08:05:16 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6199B880AAE572A87EC2; Thu, 9 May 2019 20:05:14 +0800 (CST) Received: from [127.0.0.1] (10.177.31.55) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Thu, 9 May 2019 20:05:07 +0800 Subject: Re: Why do we mark vpending table as non-shareable in GICR_VPENDBASER? To: Marc Zyngier References: <867eb09i00.wl-marc.zyngier@arm.com> CC: , Christoffer Dall , wanghaibin 00208455 From: Heyi Guo Message-ID: Date: Thu, 9 May 2019 20:05:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <867eb09i00.wl-marc.zyngier@arm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.31.55] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After thinking about it for a while, I feel it difficult to image how non shareable plus normal cacheable works for vpending table. Supposing the shareability bits are to direct the corresponding GICR to read/write table memory, if a vPE is first scheduled on pCPU0 with GICR0 and an VLPI is triggered, so a pending bit in vpending table is set by GICR0 (or ITS?); before the interrupt is activated, the vPE is then scheduled on pCPU1 with GICR1, could GICR1 still be guaranteed to see the pending bit in vpending table when the shareability is non-shareable? It seems more reasonable for physical pending table to be non-shareable, for it is pinned with one GICR. Even with this assumption, the code will still fall back to non-cacheable cacheability when we have no more choice for shareability attribute other than non-shareable, as the comment says: /* * The HW reports non-shareable, we must remove the * cacheability attributes as well. */ Did I miss something? Thanks, Heyi On 2019/5/9 15:58, Marc Zyngier wrote: > On Thu, 09 May 2019 08:10:09 +0100, > Heyi Guo wrote: >> Hi Marc, >> >> We can see in its_vpe_schedule() the shareability bits of >> GICR_VPENDBASER are set as non-shareable, But we set physical >> PENDBASER as inner-shareable. Is there any special reason for doing >> this? If it is because the vpending table is GICR specific, why >> don't we do the same for physical pending table? > That's a good question. They should have similar attributes. > >> We have not seen function issue with this setting, but a special >> detector in our hardware warns us that there are non-shareable >> requests sent out while some inner shareable cache entries still >> present in the cache, and it may cause data inconsistent. > The main issue with the inner-shareable attributes and the GIC is that > nothing in the spec says that CPUs and GIC have to be in the same > inner-shareable domain, as the system can have as many as you want. > > You obviously have built it with GICR in the same inner-shareability > domain as the CPU. I'm happy to change the VPENDBASER attributes, > given that the CPU has a mapping to that memory already, and that > shouldn't affect systems where GICR isn't in the same inner shareable > domain anyway. > > Thanks, > > M. >