Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4972845ybc; Fri, 15 Nov 2019 12:51:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxqf0EIg0UEop7FtDqMiFuHc/4EnfqgaEazIJ1tYUr2/f6zv8hFQQFj5OYu03ev8+cyFHcs X-Received: by 2002:a17:906:1e02:: with SMTP id g2mr3713101ejj.6.1573851119312; Fri, 15 Nov 2019 12:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573851119; cv=none; d=google.com; s=arc-20160816; b=xc33T7Diq5Kj96fgjOnnase4WLuUNZPqShYOOUrQFTEYMVVc7j0+MMadtKOjH4adGw e3G2Zlcc4lJ/k/EnAT1nQpJ3PZPSrQ7445cev1qmhUI5o/MFm7ZnlogfL6xGV5zfA0XQ 6N4W43+I56q1tMAB/jaJC6HcD+1UFjr7IUipUjynNxRL3tcB/YFPssY2XxcX2wt2TiTc 4h5k6QMtzYxDdfqNmxNkR37AyNqZpNEjopzamVDv/mT1S98yFYtr+5QrGHQOKJS+4fLI hecWtHA6u3v05hRL9aCSI+FiuUw3VUTmzzXrDQ4IbPlE45DRxOE/lmS/e2ckYT0NswN9 BHiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=SE7S3Pk0U4WrZY4eH0Ivsdx+ynfu0FbiZZgerWxRBmw=; b=CGpTFqal3E0vk1IXL4/uQANg0K1VchRX9Qe0ZrI9i4i7IrEnp/Of53td5WaHKYYY1P mlXLKiWgdMdSHwgQB3toSmC9Jm0QNRzb023hKYA1zX9oS8FWkAxeqa0svK3qA2p5RQxw cQtMFU5P9fwAShxrLNGTDylmWwzXy2olVo4l4L/mBhS4q1guqt/QwiEZzgNUbGrM21hN 9jXbcXeIS033LkmNLAn5Ara4yIUcobEZGNffokynMeMVHdOPCq49wlrTgPzaf6nWbqpr eIaqUVecKXj6B+6no4tiwuDXzitOglCS6SN9+U17sYYmrS6DyGxFp91IW5P70r1Whlyd OFCg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o57si7729044edc.240.2019.11.15.12.51.34; Fri, 15 Nov 2019 12:51:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727048AbfKOUt2 (ORCPT + 99 others); Fri, 15 Nov 2019 15:49:28 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:1628 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbfKOUt2 (ORCPT ); Fri, 15 Nov 2019 15:49:28 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAFKlhpZ010629 for ; Fri, 15 Nov 2019 15:49:27 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2w9nsk6pxv-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Nov 2019 15:49:27 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Nov 2019 20:49:24 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 15 Nov 2019 20:49:19 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAFKnIul27787346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2019 20:49:18 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2314342049; Fri, 15 Nov 2019 20:49:18 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A47CF4203F; Fri, 15 Nov 2019 20:49:14 +0000 (GMT) Received: from oc0525413822.ibm.com (unknown [9.85.181.122]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 15 Nov 2019 20:49:14 +0000 (GMT) From: Ram Pai To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au Cc: benh@kernel.crashing.org, david@gibson.dropbear.id.au, paulus@ozlabs.org, mdroth@linux.vnet.ibm.com, hch@lst.de, linuxram@us.ibm.com, andmike@us.ibm.com, sukadev@linux.vnet.ibm.com, mst@redhat.com, ram.n.pai@gmail.com, aik@ozlabs.ru, cai@lca.pw, tglx@linutronix.de, bauerman@linux.ibm.com, linux-kernel@vger.kernel.org, pasic@linux.ibm.com Subject: [v3 2/2] powerpc/pseries/iommu: Use dma_iommu_ops for Secure VMs aswell. Date: Fri, 15 Nov 2019 12:48:31 -0800 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1573850911-19590-2-git-send-email-linuxram@us.ibm.com> References: <1573850911-19590-1-git-send-email-linuxram@us.ibm.com> <1573850911-19590-2-git-send-email-linuxram@us.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19111520-4275-0000-0000-0000037E4E39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19111520-4276-0000-0000-00003891B93E Message-Id: <1573850911-19590-3-git-send-email-linuxram@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-15_06:2019-11-15,2019-11-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 impostorscore=0 mlxlogscore=876 phishscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911150185 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit edea902c1c1e ("powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests") disabled dma_iommu_ops path, for secure VMs. The rationale for disabling the dma_iommu_ops path, was to use the dma_direct path, since it had inbuilt support for bounce-buffering through SWIOTLB. However dma_iommu_ops is functionally much richer. Depending on the capabilities of the platform, it can handle direct DMA; with or without bounce buffering, and it can handle indirect DMA. Hence its better to leverage the richer functionality supported by dma_iommu_ops. Renable dma_iommu_ops path for pseries Secure VMs. Signed-off-by: Ram Pai --- arch/powerpc/platforms/pseries/iommu.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 0720831..6adf4d3 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "pseries.h" @@ -1337,15 +1336,7 @@ void iommu_init_early_pSeries(void) of_reconfig_notifier_register(&iommu_reconfig_nb); register_memory_notifier(&iommu_mem_nb); - /* - * Secure guest memory is inacessible to devices so regular DMA isn't - * possible. - * - * In that case keep devices' dma_map_ops as NULL so that the generic - * DMA code path will use SWIOTLB to bounce buffers for DMA. - */ - if (!is_secure_guest()) - set_pci_dma_ops(&dma_iommu_ops); + set_pci_dma_ops(&dma_iommu_ops); } static int __init disable_multitce(char *str) -- 1.8.3.1