Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp678293ybv; Thu, 13 Feb 2020 07:37:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxN6X5EUlQcs36Eo7+JVr1eTaH+G5W0WSb//z2jMBiLbgteWPcglbSutDTaGwNyKymN2TaN X-Received: by 2002:a05:6830:1e2d:: with SMTP id t13mr14255334otr.128.1581608258304; Thu, 13 Feb 2020 07:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608258; cv=none; d=google.com; s=arc-20160816; b=WLE861MZO+cIsvnXtpUh5u5HnfBDLYCLibnAe5+Vp3PjISTTRKySSr4KOgTwU71QHw e0c+1GyrpU9W1D1wyP3jQVv93Xcgz3uvL3jcPiv2O94VyEjqWiuf3Z5xqHHVbmZ89rTD K/dxPKXBkCYL5Wlk0bNQ6Q3xBLoKNBBxi127pN7+S0tmA8ZW4JFVVVs67rxlyvFGj+xy nKR3Ck+b2rF6fAEd2rmQ++plJal4Z4Emj9BfxvSBQjGfydZfYa5siy0cKcWslsN6todr NeBGrLqsJKmJTN+JTimKTNAxYW04cwHkeif/blygKfJ4kcc2TaK4+ioPbKCXsJToS2XI 8Z7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xLI9q9suIkiKg22Xpu5Bxp+P1QRod04FcIpQNWIHS/8=; b=NN3YN2uQ1RCv0w1EYpRm1wnwFWvIupNHFQuZTiw5HEnrBOA3MSnqzAuoQO2VMZ8AHY xlPNX3zU6AZqRCc1XVRHCdhaI5I/4N0LJ1AJ45ubkftQNC9PjhqN95oHTo1qOM1FrC1C YLt0zML6xguxpTAZYX2IsvIYFVLXs7xVByN7TAzxBek1zYFeRoWNnSeDT7ZrOfCkRmxo dZFCIxsgv2oja76HOKFL1yetUYVCebTYunGrhywUOL1PSv2Gg4Xeq/U8e7+d03DWI8fV B0Dbyjvbkcu9u61AD3L2HD/LNyAdZ+mmfMkaNUyglgWwoA7vIw68DXrPs1ay94Lhjeed JmOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=psCFahKr; 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 z14si1301215oih.89.2020.02.13.07.37.26; Thu, 13 Feb 2020 07:37:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=psCFahKr; 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 S2387864AbgBMPad (ORCPT + 99 others); Thu, 13 Feb 2020 10:30:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:50428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729076AbgBMP10 (ORCPT ); Thu, 13 Feb 2020 10:27:26 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E486524689; Thu, 13 Feb 2020 15:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607645; bh=r9xKMrfjsCH7A7sq9FAn3xenWtfx94nRGSwIgf1QNaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=psCFahKrMW2fCU1KgLBuUnVOeOqLn1dwRSE+QB8P6VaZAZL98rdbJokOnbF06Kxmy YRzz7NRNYU/VuhZtIeK65UUaLjEAA+z5AyFUMibMXNyKXAh4KvoOSqVM3UQqQkSusv GJmBN+2soSLrU0ZILlqOqBxL5e9hmBLQaMhjMAKo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ram Pai , Alexey Kardashevskiy , Thiago Jung Bauermann , Michael Ellerman Subject: [PATCH 5.4 53/96] Revert "powerpc/pseries/iommu: Dont use dma_iommu_ops on secure guests" Date: Thu, 13 Feb 2020 07:21:00 -0800 Message-Id: <20200213151859.926436608@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ram Pai commit d862b44133b7a1d7de25288e09eabf4df415e971 upstream. This reverts commit edea902c1c1efb855f77e041f9daf1abe7a9768a. At the time the change allowed direct DMA ops for secure VMs; however since then we switched on using SWIOTLB backed with IOMMU (direct mapping) and to make this work, we need dma_iommu_ops which handles all cases including TCE mapping I/O pages in the presence of an IOMMU. Fixes: edea902c1c1e ("powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests") Signed-off-by: Ram Pai [aik: added "revert" and "fixes:"] Signed-off-by: Alexey Kardashevskiy Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20191216041924.42318-2-aik@ozlabs.ru Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/pseries/iommu.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "pseries.h" @@ -1320,15 +1319,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)