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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 ABECFC433ED for ; Wed, 19 May 2021 09:46:25 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72347611B0 for ; Wed, 19 May 2021 09:46:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72347611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=hEBpQyEF3mmcHQdPQfppM19hV+lKYiMqxzGbOCnOPIw=; b=fTUxYooX+MrWmGJT/GDuGH4LqF BKoawswrdS5X7fS5KZ1DzbRfo98rFytGwxD1l2W/aNw2yWhb+3l9dx9K87Lj1gFiW1slzZj0eVDd9 8exB6vSvmQGokckIv60UCXcyO7vfpog+HlqDB3FJmHYt4EZGOdAs+FGF8tWByVVDKgmGohM0nNE4Q MdX689SMfwwifwC844cJh2pZnNgVHGbfr3uErOj3zs3yEPDkCMOPDDD0L8aSN86FZiVaOcSBfmL0u YI/RIV0/yMFBUgtC7aAxP9YRsS9phXnOTLjR836EXGpsldtWKB76iHIch4mFstYOsGZISTx5dZxYd 4ulx05MA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljIkb-003Tl1-Dk; Wed, 19 May 2021 09:44:25 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljIkY-003TkU-6O for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 09:44:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description:In-Reply-To:References; bh=4X3muKIzO6SON87shWo+JuqBEimNtVlbB0d1KXyWJ90=; b=AOaU/wFQ0kf+OyZOQQBGFsSR4C JE2IwgDn8leIh65I6iYv8R+ReOK7FTIOedSd6Lt8/uKCTHg3SL3JeiXecnfuKw8T58OK+dPFZRl+e MctbwXveR5YSnIH7mDiKBFmvOdmhQoKNGiZM2GmMntxazWf0GS3pjPqOFH2SiVGGEaKjFcwza7M9Z 7a9hny9oPcErHYl9+rUtNaTJvCVfN33j/7bFPrJEhywbwZ8GPw3ITsfCqQ33Wxs3Tz5YJ28r5mLFI +DUykzM6tEtjuOdmZbB6P3e46s9q7jdPoS0sqSGiqQclwDPrVMK6QXseyZzKtnbJKsRR42dEEHaEt RDlT3PMw==; Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljIkV-00FKGW-A6 for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 09:44:21 +0000 Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FlSXm3SfrzQpfn; Wed, 19 May 2021 17:40:40 +0800 (CST) Received: from dggema765-chm.china.huawei.com (10.1.198.207) by dggems702-chm.china.huawei.com (10.3.19.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 19 May 2021 17:44:10 +0800 Received: from DESKTOP-6NKE0BC.china.huawei.com (10.174.185.210) by dggema765-chm.china.huawei.com (10.1.198.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 19 May 2021 17:44:10 +0800 From: Kunkun Jiang To: Will Deacon , Robin Murphy , "Eric Auger" , "moderated list:ARM SMMU DRIVERS" , "open list:IOMMU DRIVERS" , open list CC: , Keqian Zhu , "Zenghui Yu" , Kunkun Jiang Subject: [RFC PATCH v1 0/2] iommu/arm-smmu-v3: Add some parameter check in __arm_smmu_tlb_inv_range() Date: Wed, 19 May 2021 17:43:05 +0800 Message-ID: <20210519094307.3275-1-jiangkunkun@huawei.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.185.210] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggema765-chm.china.huawei.com (10.1.198.207) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210519_024419_535211_C0E385BB X-CRM114-Status: UNSURE ( 7.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, This set of patches solves some errors when I tested the SMMU nested mode. Test scenario description: guest kernel: 4KB translation granule host kernel: 16KB translation granule errors: 1. encountered an endless loop in __arm_smmu_tlb_inv_range because num_pages is 0 2. encountered CERROR_ILL because the fields of TLB invalidation command are as follow: TG = 2, NUM = 0, SCALE = 0, TTL = 0. The combination is exactly the kind of reserved combination pointed out in the SMMUv3 spec(page 143-144, version D.a) In my opinion, it is more appropriate to add parameter check in __arm_smmu_tlb_inv_range(), although these problems only appeared when I tested the SMMU nested mode. What do you think? This series include patches as below: Patch 1: - align the invalid range with leaf page size upwards when smmu supports RIL Patch 2: - add a check to standardize granule size when smmu supports RIL Kunkun Jiang (2): iommu/arm-smmu-v3: Align invalid range with leaf page size upwards when support RIL iommu/arm-smmu-v3: Standardize granule size when support RIL drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.23.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel