Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4222893pxf; Tue, 30 Mar 2021 02:22:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxs6wDY+pd9gT54rDP8c1N0leeAyMlChgDKLJpuMHybJJ7dRjN5qscbmTHea090TTAryPuG X-Received: by 2002:a17:907:629c:: with SMTP id nd28mr21971951ejc.267.1617096137254; Tue, 30 Mar 2021 02:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617096137; cv=none; d=google.com; s=arc-20160816; b=otvs6+l7N9Nj7QcNmLlhdCYdjMglfBFXg+ZBjSK8lYNpap0t+8X3eMizIJpxuvjhiT guX6CNRFQbUj5wWIHWIoD5efvcNT1vH19TtALAmE6G/5cfxWWvm6yyPk94Rnn4wXEP5f n4gkhmsSP9PXWLXRZ6LIp0MpbLt9jEhOFGQa17Xt+8xyWjI1XAiqbHSIE6gBxvf6by3o EILoOIY7d1ehltjBz/wzzY/swK3f08ZGxBzwxJ4b+03YVBahpMdCOe/UiKvikAv2MGtX H1b6UzgR8iX2MfjMwN9r0/RhmgGcJUuoplOILUPfmAulLOYHaSN+tBqJIjLbjFpkx14P igJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=1YiFrjeUMyx3w8ZIA+MnU1vRe/fWq+TuWdwHP7jZsNA=; b=DJvOdDKl66t/BOcuTqCzvTkmLdWilves72BwODTPykZ4XDib+4l8fSb6+lUvu58mqS e3jucX6YZNId9IiRX3slF7Vs1qmeoXAYuh7pCLwvxRUFb1rYOnFzbkPyGROjK0b70pan YYUP3zRIvN+xzhFvnfEwQ/8rvF7+a28jP9CJZlSeeH/dCpLM/SlhM0bHa58eLFpWXjXB NU7k+tJ4AcBbZszqIWyE++XfKxgJJ3I6WpzAztxFJD8lpBvrDvhhz4paBEX2KQoglVOG 1g6jkQvviYTa7o1vufG7bBeBH7rLL2635/ozWSo2yMsWq1fRHlKJDfSi6L19jpPDKgT/ c8TQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q27si16096665edi.328.2021.03.30.02.21.50; Tue, 30 Mar 2021 02:22:17 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231614AbhC3JSe (ORCPT + 99 others); Tue, 30 Mar 2021 05:18:34 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:15395 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231665AbhC3JSK (ORCPT ); Tue, 30 Mar 2021 05:18:10 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4F8kMt0wnMzqSNJ; Tue, 30 Mar 2021 17:16:26 +0800 (CST) Received: from [10.174.185.179] (10.174.185.179) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Tue, 30 Mar 2021 17:17:59 +0800 Subject: Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs To: Eric Auger CC: , , , , , , , , , , , , , , , , , , , , , , , , References: <20210223205634.604221-1-eric.auger@redhat.com> <20210223205634.604221-7-eric.auger@redhat.com> From: Zenghui Yu Message-ID: <7a270196-2a8d-1b23-ee5f-f977c53d2134@huawei.com> Date: Tue, 30 Mar 2021 17:17:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20210223205634.604221-7-eric.auger@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.185.179] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/24 4:56, Eric Auger wrote: > @@ -1936,7 +1950,12 @@ static void arm_smmu_tlb_inv_range_domain(unsigned long iova, size_t size, > }, > }; > > - if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { > + if (ext_asid >= 0) { /* guest stage 1 invalidation */ > + cmd.opcode = smmu_domain->smmu->features & ARM_SMMU_FEAT_E2H ? > + CMDQ_OP_TLBI_EL2_VA : CMDQ_OP_TLBI_NH_VA; If I understand it correctly, the true nested mode effectively gives us a *NS-EL1* StreamWorld. We should therefore use CMDQ_OP_TLBI_NH_VA to invalidate the stage-1 NS-EL1 entries, no matter E2H is selected or not.