Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3545925ybc; Mon, 18 Nov 2019 17:16:50 -0800 (PST) X-Google-Smtp-Source: APXvYqzXu3B7iSrYdQJtb5Nt876EZVFv/sDytF1ewRZ4iBrVThlWFyQKlFNi2i+iQaeaZaSL4EeG X-Received: by 2002:adf:e40e:: with SMTP id g14mr1937779wrm.264.1574126210533; Mon, 18 Nov 2019 17:16:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574126210; cv=none; d=google.com; s=arc-20160816; b=mVCNOFwUKuc5pN2pNfTLDv94bobzrGh6Lgl9lXGC1EtW2s/CYv0dhkxjg0PZkI5guS qU76lKeeYWJ6BmgvWymvocqwnonRnN4mdb8ACt1fVM4jUh049dcQX/gdRolHUijUCA42 8z3HP6CYyVo8uvTtzrzotCFhqZIJGwaNczBzpY3hldNIc2G0Inv2p9cAZDX6aPm5utLM cPv2bcZG3+9d6H8IjlLLCZPSs7UGxtGmV01tKaUHRwIQPnYHB5pa2T44qfqLZWTLuKwI KPF0O8/YogMDUtniwie5mdwKe/nCyAWEygKlScmzWKsV6x7+1e+usQ9zC617fXD1pYnt tsuQ== 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=l4EKLQuj1icjkt61xliFl1n5r5T32OhWfYUWUO+9QSA=; b=xefWHmYqWRa4zzrw9qoUgHcI/6h8LKQ+qfPer3rfehZYwEdVtC2BcClWeaXyrP3a4n r59v0Tt6h0ZfYYdfP2AIb76VxVso29hZowFj8bbRGWlQdtpkvqD/iHHMUE6wQHcKsFG9 PVpKE52BVKHV3XaTftF3l/zL63JMJezbxtO5zNGLteJzO7bc1+WWJMX2D0NmCAFhaTW0 ljHhMksP0rCUp3QzLau0u2HalwwzwxWaBCPxA37YT+KTBYMNyhEnfZZKaY29ClYhYqK6 W51z0f68uRlF8q3kpd0TNTYDZBCSa6Q8ZNsalqqdW8MsJbpIvWJyHF/xcn9BRwrt/FVp TFXA== 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 l27si15636183edc.358.2019.11.18.17.16.07; Mon, 18 Nov 2019 17:16:50 -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 S1727092AbfKSBNz (ORCPT + 99 others); Mon, 18 Nov 2019 20:13:55 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6249 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726775AbfKSBNy (ORCPT ); Mon, 18 Nov 2019 20:13:54 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id F23E3FCA1D89BD2D1402; Tue, 19 Nov 2019 09:13:52 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 19 Nov 2019 09:13:46 +0800 Subject: Re: [RFC PATCH v2] arm64: cpufeatures: add support for tlbi range instructions To: Marc Zyngier , Zhenyu Ye CC: Will Deacon , , , , , , , , "linux-arm-kernel@lists.infradead.org" , Linuxarm , Shaokun Zhang , wanghuiqiang References: <5DC960EB.9050503@huawei.com> <20191111132716.GA9394@willie-the-truck> <5DC96660.8040505@huawei.com> From: Hanjun Guo Message-ID: Date: Tue, 19 Nov 2019 09:13:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Cc linux-arm-kernel mailing list and Shaokun. Hi Marc, On 2019/11/11 22:04, Marc Zyngier wrote: > On 2019-11-11 14:56, Zhenyu Ye wrote: >> On 2019/11/11 21:27, Will Deacon wrote: >>> On Mon, Nov 11, 2019 at 09:23:55PM +0800, Zhenyu Ye wrote: [...] >>> >>> How does this address my concerns here: >>> >>> >>> https://lore.kernel.org/linux-arm-kernel/20191031131649.GB27196@willie-the-truck/ >>> >>> ? >>> >>> Will >> >> I think your concern is more about the hardware level, and we can do >> nothing about >> this at all. The interconnect/DVM implementation is not exposed to >> software layer >> (and no need), and may should be constrained at hardware level. > > You're missing the point here: the instruction may be implemented > and perfectly working at the CPU level, and yet not carried over > the interconnect. In this situation, other CPUs may not observe > the DVM messages instructing them of such invalidation, and you'll end > up with memory corruption. > > So, in the absence of an architectural guarantee that range invalidation > is supported and observed by all the DVM agents in the system, there must > be a firmware description for it on which the kernel can rely. I'm thinking of how to add a firmware description for it, how about this: Adding a system level flag to indicate the supporting of TIBi by range, which means adding a binding name for example "tlbi-by-range" at system level in the dts file, or a tlbi by range flag in ACPI FADT table, then we use the ID register per-cpu and the system level flag as if (cpus_have_const_cap(ARM64_HAS_TLBI_BY_RANGE) && system_level_tlbi_by_range) flush_tlb_by_range() else flush_tlb_range() And this seems work for heterogeneous system (olny parts of the CPU support TLBi by range) as well, correct me if anything wrong. Thanks Hanjun