Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp261660pxv; Thu, 8 Jul 2021 20:36:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHHEN67h7HlNN2xPiZBQnDc/RW8nBu2QmhHsZN7b/DYTFQIt54rzajri9zW0BgKb4x6e/O X-Received: by 2002:a02:620a:: with SMTP id d10mr30804576jac.22.1625801777021; Thu, 08 Jul 2021 20:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625801777; cv=none; d=google.com; s=arc-20160816; b=PdR4S6xvpY/PY6tYs06NtXgW8DoDlaKVVcqVMje9ZxIBFyWkg8+VZ4BIU59AIbmo1M JqAbQJgvVK5xUsdeEGA+xSdjxQw+5NFaroO9gEDiODpj9r/4CrjZ1l1y/GrzzlVWL71O uLxFPNTKDU+MHKhkHb3lsedMbAJp+zcLMxiFg9eU4O1nvLip+InSYzwnOMYT1Jg5TRCr 2rLVF+vig4NCt6zHf89b9YlviOlyvWp5L3WZRWXUGahWD+y0WqwHhhiAehMz7wsPeuIf SYOTVvs5XjD5Bhgi5zNLxL0tSz8U75aFOV9dfVPdXTHHBGMhqJdRdIV5sBJHhdPLsTIo uXFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QgqesoC5qpl/edbOBllLil92AKJcrUsJTLsQmBAkv3M=; b=ctw1VgDGftolZXiun2PKTVmSQWlcslyxKsmWtNBqwBw5bxaUa3NEL3or+d0fBla51t vXTWEq6QCFt4PAu7G7nVkHQ7/fqah9DFCduTxaXsLYAdc2/hml1qFow/0KoxPa7/Q8LY 7kZXeqL799wbBbNATBOd5UcmKDCLqQVe7xd2j7kSAfjqpI2sf1/QtkyrL9jwOfhm98Yn OmwPtnin6r2Na21kPjPX8fYnW50qUIvIsA2rUZfkRFfSsVoZ5v9zEGohF5cnzrZ9MK2i ix8cwjODpZ02vmFGGJWs6mnotLgudvx+wTTkWSge0VxENxSPkjZZrkKXtJzSCuevf2Jt Y8bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="WSvB/aHB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si4711673jaj.40.2021.07.08.20.36.01; Thu, 08 Jul 2021 20:36:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="WSvB/aHB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230489AbhGIDiA (ORCPT + 99 others); Thu, 8 Jul 2021 23:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbhGIDh7 (ORCPT ); Thu, 8 Jul 2021 23:37:59 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13165C061574 for ; Thu, 8 Jul 2021 20:35:17 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id fs7so5018149pjb.2 for ; Thu, 08 Jul 2021 20:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QgqesoC5qpl/edbOBllLil92AKJcrUsJTLsQmBAkv3M=; b=WSvB/aHB4PyQYa6s2owVlOvE5WTOZCBJtNvDp54FRHQ8Y5lQJLLT4k8EHF21mdgHQE dGaYSI2/YJ2vI6qpRcNDge5Vc/tCubf/Gfcb7eWHiAMTZnulsUGcqxGr/HtgRIpPmlhU A7OhK5uxFpSwpy/KUVpCKDa9Z0lYxlB35QKww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QgqesoC5qpl/edbOBllLil92AKJcrUsJTLsQmBAkv3M=; b=SHrOOY5EefPJISkxEoDplX1e+E4E/h+FMo428wqpxJ1Pl7qsOB0hxLoxycc2a+bSNi Qz152BJZOYNx3WsPW25BVTz14uSKrtuhdrZanUM8lKMvwqdUrdpeAvgWFUKiXdFpTYYk ufHEkEkA4PucUivsNJ2GryI5nehg0vnHmwhY9lYbWfYYsYP13ZSSyx3XlQSRDXDIvdUZ 4mWihPCWH4rtMeHEyuGi9ywFcbZgVpdAMjsF6S30yrQo7Kr/sRuI0lVOW7kksy7Jva15 t8EFzEWoQ08mydu+QLNycrgs/h/CqanRe6eet1/yBOgF4NQssMDJpm3wVkv+IRZ28VuN 0CTw== X-Gm-Message-State: AOAM5302D/6cOxAoDVoEVuJ2eihIMswCCXOpeg6SUl14KgMa+cI4K4VQ f/+xPJ+XxaIkFdWIyRQXZm/n4w== X-Received: by 2002:a17:902:b111:b029:129:5cd0:110e with SMTP id q17-20020a170902b111b02901295cd0110emr27867718plr.51.1625801716483; Thu, 08 Jul 2021 20:35:16 -0700 (PDT) Received: from localhost ([2401:fa00:8f:203:d47a:af0a:d5b9:e774]) by smtp.gmail.com with UTF8SMTPSA id gk20sm3942228pjb.17.2021.07.08.20.35.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jul 2021 20:35:15 -0700 (PDT) From: David Stevens X-Google-Original-From: David Stevens To: Robin Murphy Cc: Joerg Roedel , Will Deacon , Lu Baolu , Tom Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, David Stevens Subject: [PATCH v2 0/4] Fixes for dma-iommu swiotlb bounce buffers Date: Fri, 9 Jul 2021 12:34:58 +0900 Message-Id: <20210709033502.3545820-1-stevensd@google.com> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Stevens This patch set includes two fixes for bugs caused by mixing up the original buffer's physical address and bounce buffer's physical address. It also includes a performance fix that avoids an extra copy, as well as a general cleanup fix. The issues were found via code inspection, so I don't have any specific use cases where things were not working, or any performance numbers. v1 -> v2: - Split fixes into dedicated patches - Less invasive changes to fix arch_sync when mapping - Leave dev_is_untrusted check for strict iommu David Stevens (4): dma-iommu: fix sync_sg with swiotlb dma-iommu: fix arch_sync_dma for map with swiotlb dma-iommu: pass SKIP_CPU_SYNC to swiotlb unmap dma-iommu: Check CONFIG_SWIOTLB more broadly drivers/iommu/dma-iommu.c | 63 ++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 30 deletions(-) -- 2.32.0.93.g670b81a890-goog