From patchwork Sun Jun 10 11:07:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 138189 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2893175lji; Sun, 10 Jun 2018 04:09:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJfgPn1buaXH7egoMvc6tVYQfZw+k2aXHyYTgQ0BsAEtLGzq+EKrBH5gjT/HAHfTDOADfQS X-Received: by 2002:a62:830e:: with SMTP id h14-v6mr13502966pfe.64.1528628962991; Sun, 10 Jun 2018 04:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528628962; cv=none; d=google.com; s=arc-20160816; b=lH2DkK2NuUTPwLeefBWelhYp+e4bhjCCKPaAHcikY2de1WsJFA2b7c0bnMYzTDV5LS t4cw8z0cMwt6NahPDCV8O+hu8BaGDhsZxhH3xkVmbfXCPxFzKGThc12F9ZqSjKx4q/Cl ppSUmPcJhyCNURhK27lTj4GrqDmHyaTLjnkt5SXNws8FFr8yjbxVeIJiX4en9mPxEdoB ro1gebAoyqFIgKOft5XSUuZ/HXy3v465pWh+stdA2aNPABCCeDjFQV7/u6dB4SaPhCr8 0PK3SNSrDv8QF1ugq3tuJDi4wU4ypkCEAGIYjAhwW36jeZSzALx8EdNxbbu2qfE82rir gyuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=3l3Sfu+jVKB7x4G1++tFWJXPM2PLGWRTxV7EAlyjL8c=; b=E5Fs7DadJYjRGPHcVgXzGwtfqm0ezH8I8IK6MsVjLmBZFArr8z2iOuDtZa6r44qQWz IAnsMSfHKynCQGtyrX//W+896DvsD5S9079Txc/QSJhv9rKYTFFIkoqWv6WGpT7lw5tW MUF4zOOEgIIZS7Mi11PTeRIw/QJCp/F696cD/BPdLftw2+B+2M8b/faEa14AQYwkpfRg PJ71VSG8mAbRUR+sYlUIdO/Dc1yS/KEW5OALICJUVW3rssYPi+nI/s3FeBB5AFV4cIi+ izkBtJN6BpGeUydcUK6v+X+veUDGPLX3SIIeRHSU5iBOHWKxj+7S6oPmuCe85cPuKq83 dRsw== 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 p12-v6si45236816pll.142.2018.06.10.04.09.22; Sun, 10 Jun 2018 04:09:22 -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 S1753912AbeFJLIk (ORCPT + 30 others); Sun, 10 Jun 2018 07:08:40 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:42728 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753873AbeFJLIh (ORCPT ); Sun, 10 Jun 2018 07:08:37 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4890E73957343; Sun, 10 Jun 2018 19:08:31 +0800 (CST) Received: from localhost (10.177.23.164) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.382.0; Sun, 10 Jun 2018 19:08:22 +0800 From: Zhen Lei To: Robin Murphy , Will Deacon , Joerg Roedel , iommu , linux-kernel CC: Zhen Lei , Hanjun Guo , Libin , Guozhu Li , "Xinwei Hu" Subject: [PATCH v2 0/5] add non-strict mode support for arm-smmu-v3 Date: Sun, 10 Jun 2018 19:07:18 +0800 Message-ID: <1528628843-10280-1-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v1 -> v2: Use the lowest bit of the io_pgtable_ops.unmap's iova parameter to pass the strict mode: 0, IOMMU_STRICT; 1, IOMMU_NON_STRICT; Treat 0 as IOMMU_STRICT, so that the unmap operation can compatible with other IOMMUs which still use strict mode. In other words, this patch series will not impact other IOMMU drivers. I tried add a new quirk IO_PGTABLE_QUIRK_NON_STRICT in io_pgtable_cfg.quirks, but it can not pass the strict mode of the domain from SMMUv3 driver to io-pgtable module. Add a new member domain_non_strict in struct iommu_dma_cookie, this member will only be initialized when the related domain and IOMMU driver support non-strict mode. Zhen Lei (5): iommu/arm-smmu-v3: fix the implementation of flush_iotlb_all hook iommu/dma: add support for non-strict mode iommu/amd: use default branch to deal with all non-supported capabilities iommu/io-pgtable-arm: add support for non-strict mode iommu/arm-smmu-v3: add support for non-strict mode drivers/iommu/amd_iommu.c | 4 +--- drivers/iommu/arm-smmu-v3.c | 16 +++++++++++++--- drivers/iommu/dma-iommu.c | 25 +++++++++++++++++++++++++ drivers/iommu/io-pgtable-arm.c | 23 ++++++++++++++--------- include/linux/iommu.h | 7 +++++++ 5 files changed, 60 insertions(+), 15 deletions(-) -- 1.8.3