From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C1FBC433E6 for ; Fri, 28 Aug 2020 09:28:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D3BB6208D5 for ; Fri, 28 Aug 2020 09:28:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3BB6208D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CC6366B0002; Fri, 28 Aug 2020 05:28:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C76226B0003; Fri, 28 Aug 2020 05:28:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8B656B0006; Fri, 28 Aug 2020 05:28:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0245.hostedemail.com [216.40.44.245]) by kanga.kvack.org (Postfix) with ESMTP id 9E4396B0002 for ; Fri, 28 Aug 2020 05:28:45 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5E10A824556B for ; Fri, 28 Aug 2020 09:28:45 +0000 (UTC) X-FDA: 77199452610.20.run44_4f0c5f727074 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 2EAA0180BFBA1 for ; Fri, 28 Aug 2020 09:28:45 +0000 (UTC) X-HE-Tag: run44_4f0c5f727074 X-Filterd-Recvd-Size: 2605 Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 28 Aug 2020 09:28:43 +0000 (UTC) Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 33BACF005785721D2BAA; Fri, 28 Aug 2020 17:28:34 +0800 (CST) Received: from [10.174.185.226] (10.174.185.226) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Fri, 28 Aug 2020 17:28:23 +0800 Subject: Re: [PATCH v7 18/24] iommu/arm-smmu-v3: Add support for Hardware Translation Table Update To: Jean-Philippe Brucker , , , , , CC: , , , , , , , , , , , , , , References: <20200519175502.2504091-1-jean-philippe@linaro.org> <20200519175502.2504091-19-jean-philippe@linaro.org> From: Zenghui Yu Message-ID: <472fdcf6-f306-60bc-5813-4ad421ee03f2@huawei.com> Date: Fri, 28 Aug 2020 17:28:22 +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: <20200519175502.2504091-19-jean-philippe@linaro.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.185.226] X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 2EAA0180BFBA1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2020/5/20 1:54, Jean-Philippe Brucker wrote: > @@ -4454,6 +4470,12 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) > smmu->features |= ARM_SMMU_FEAT_E2H; > } > > + if (reg & (IDR0_HA | IDR0_HD)) { > + smmu->features |= ARM_SMMU_FEAT_HA; > + if (reg & IDR0_HD) > + smmu->features |= ARM_SMMU_FEAT_HD; > + } > + nitpick: As per the IORT spec (DEN0049D, 3.1.1.2 SMMUv3 node, Table 10), the "HTTU Override" flag of the SMMUv3 node can override the value in SMMU_IDR0.HTTU. You may want to check this bit before selecting the {HA,HD} features and shout if there is a mismatch between firmware and the SMMU implementation. Just like how ARM_SMMU_FEAT_COHERENCY is selected. Thanks, Zenghui