Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp311144lqh; Mon, 6 May 2024 22:37:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKxt/KfVotkB6XqHJXDZZQoS9QoVvlIkCIzIy/6WVHmyBGhYkG2877JXWLfWRoiBvZcHm/m5Qetrlr/10sh/BqVwzSaAppPaztFSWNTw== X-Google-Smtp-Source: AGHT+IG6JFuYWi07xWNVJgSWgH0NRsdMdq0JuXpKONDVM/vCXb5lydcQRlSQdCaGUVXM07zGGgPB X-Received: by 2002:a17:903:41cb:b0:1ec:25d3:7335 with SMTP id u11-20020a17090341cb00b001ec25d37335mr2437452ple.26.1715060245924; Mon, 06 May 2024 22:37:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715060245; cv=pass; d=google.com; s=arc-20160816; b=i0SjwBsc/eWDhwdO0TgsZ+pAYE15LalwRbrmFWMXfBFfeMHn/HscjxFMSyGsJHwXbz 8A29mzTlWkiRVQGRy+NTatojnHM260ikYed1VCTNJb0/jHCSSGv5Pv/7250WoVNxvuLa p9QPEj3qd9KzEKabrCKomtBNJzaBr+vXWVuQVCt4xvvAB+8p2xld13zd3hvHT/hRz7pM 92Q6fOg8TXGQ9EkCI3RzZesOJGFE6LBUjrvgTmUAAALqmlhpb5LySboHKDi3KcXVNFYT OxaC5VcHgloCEzJjIulvWqreGIpXGitcKfhidKAf78bom5WV2rscpZHTriOv1ZvWRjjN prvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=9Z2Lgd6+edwKLKM6MPj84lpLVlsqiwAHsCvLAfO+JYM=; fh=XV0pZcLZsnjlNd+ZC//DX/CxHw6OMrnz4NBuAaXcNAc=; b=jcFcs6mFYCT4MMpGCVYLCvIJAdVIdq6q7y3Toz2TzfcbQA15/hUIsHWZvUqN54Fh3U MKplf8JnyH2wHnf1qT+vz5E8B8C/Vt90KqWOCtmWR9JbaRzqIulc+hSaF9oX8zM922Ej 7oR+aZ8XXy0TNj8N/XmYVf0XoR1ggUv3+h2eWvIHTbuAahzqUWo3iBvrEvA3wrdh0dxZ s+BN7xXXWbVXPHDCHetWlIPl8Eacce2A4RdU2ENZYB9ZzvG/YggxmReTTYgKWc4Y4+78 KOuKyqEt4jOaBMlUHMw3QPPNj/tG28iSOWMpGERO25ImuTSe44zT7tI2TSVHPsaaiWO1 bVaQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-170699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170699-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j1-20020a170902da8100b001eb6b4eab7bsi9786866plx.63.2024.05.06.22.37.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 22:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-170699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170699-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CADE5B22B75 for ; Tue, 7 May 2024 05:36:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB2136BFA2; Tue, 7 May 2024 05:36:17 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D0D76BB20 for ; Tue, 7 May 2024 05:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715060177; cv=none; b=Jrz/HSIpe7AydNFXyG2mCqIn0QjmE3aAdXwDqKJy/RAxvPatmoMaSOC8J1G+qRAlob2emCnUrhohTpV8sBj8ufJyV8/OFL4BDsDEWDia1Evxt67EbnE0rt6m0MSeFvan7AZoZaDAy6LYsqnSXWfPKyEeVRKmYMV0ue67Ialqv3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715060177; c=relaxed/simple; bh=1P2VbTrkd4MKGFI2HmWOgvqPu1CNUdtpUC7dSk0aT0w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AhV6D06DlEboNF7UMaNqDJjzqusb9PpycDmbTgOASfM0XAxFcP6aizs8BdG/iAnrTqnU4vVSmX/xyr/nxzB1JoExyVpo2mN6pPjC2cebr49woZ3pj+kEh/+YJ0OYek0ANXKV6fEdSe5zcmDWBy3iKvG941h01+27zUvKLtt26h8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 66D67227A87; Tue, 7 May 2024 07:36:04 +0200 (CEST) Date: Tue, 7 May 2024 07:36:04 +0200 From: Christoph Hellwig To: mhklinux@outlook.com Cc: robin.murphy@arm.com, joro@8bytes.org, will@kernel.org, jgross@suse.com, sstabellini@kernel.org, oleksandr_tyshchenko@epam.com, hch@lst.de, m.szyprowski@samsung.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, petr@tesarici.cz, roberto.sassu@huaweicloud.com Subject: Re: [PATCH 2/2] iommu/dma: Fix zero'ing of bounce buffer padding used by untrusted devices Message-ID: <20240507053604.GA31731@lst.de> References: <20240408041142.665563-1-mhklinux@outlook.com> <20240408041142.665563-2-mhklinux@outlook.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240408041142.665563-2-mhklinux@outlook.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Sun, Apr 07, 2024 at 09:11:42PM -0700, mhkelley58@gmail.com wrote: > I've wondered if this code for zero'ing the pre- and post-padding > should go in swiotlb_tbl_map_single(). The bounce buffer proper is > already being initialized there. But swiotlb_tbl_map_single() > would need to test for an untrusted device (or have a "zero the > padding" flag passed in as part of the "attrs" argument), which > adds complexity. Thoughts? If we want to go down that route it should be the latter. I'm not sure if it is an improvement, but we'd have to implement it to see if it does. > The commit ID of Petr's patch is X'ed out above because Petr's patch > hasn't gone into Linus' tree yet. We can add the real commit ID once > this patch is ready to go in. I've fixed that up and commit the series. Thanks a lot!