Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp529793lqb; Thu, 29 Feb 2024 07:48:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWShPU+bdMZFzWusa3b5x0Ov8cwqYflcQJvrOGzeKW6V7xGWHSOExA/LXnivr6WYAUOjxPEKHZ6qcwfbVA1sm1KcwZN+TZzipcrvYcuQ== X-Google-Smtp-Source: AGHT+IHlofezrNUl5+rVQrJiiq5L2InoRCSQfxBtaMeltu361NlI4/BnqKGDklHK/hl1YE7lb6Af X-Received: by 2002:a05:620a:1a1a:b0:788:2ef:fab8 with SMTP id bk26-20020a05620a1a1a00b0078802effab8mr1089530qkb.13.1709221694627; Thu, 29 Feb 2024 07:48:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709221694; cv=pass; d=google.com; s=arc-20160816; b=AYPZ/RQ6vfnzVhvaRmQFpb0GsiDaQpcsLqOHwlZWk7fEjnpsONCo6/4jkv3aBah9tn s9FiHqUyp+/iGEFqHeHe26U167Mon9MmQ0ojUnieggOX74YrIKM4Kk46ENEmGGwGabNO q/BeLP41gayhWz1bOZuXJSt+bf2agcusL10lgEZ5I4P/AVCbuW6Se84FmpuwQNuzqA7s zd5/7KDtERZVMcdXExCev37aQm9UUkT+tfNTshuchTwc1dbVF6CxmXdP53AY0LUM1Hlq udHdDoOzEyz2bhAguoRm5IVyrhh+G1RFy5oJpE8ONzkz5LC6cfbrckOfVuLT+EI4f1YQ mJ5w== 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=LIRLwhAyx+lXq2JBklchwg36MpHvmxcqfi1x+dmQFVk=; fh=s05LApKwerYaIGLfwm1c6K+uTXe2qV4PjU5vbYnp0J0=; b=vfgjuWtMSN+Vp4jTSGdx34m3VX+1dJo95YEEEfi2kOQCo2MjT1rY5TjALruZYNx3Gr 6AjxKVHU0IcMqa6s/80zTKYHh0XL/KUcHiuhyzs7iY0iDZQ0xvVZrsPMlb304sPgZrIP sb7/smVQNFEHLq2IuJSImmKwVzV934xInmDzwCDkKo5WawN8q65ryRNGs1Ppj9lP+EHj Yuzdg/x0XOkdRMpcZtK4MrhKFwqiTHncGhDZQsxQvY2TrVsDInpvsyZJCyiLckwZottd 3XtPf1RD5fIsx7kVF2nf1mYLid8WQic0bwgjuTxC273fOiLbhLnHAzjDLTzPX4gxpomn Q4nA==; 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-86947-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86947-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k15-20020a05620a0b8f00b00787bb1d7a75si1581014qkh.117.2024.02.29.07.48.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 07:48:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86947-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-86947-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86947-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5B5C61C22457 for ; Thu, 29 Feb 2024 15:48:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0E7D14A4F1; Thu, 29 Feb 2024 15:48:04 +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 0C47F14A4D8 for ; Thu, 29 Feb 2024 15:48:01 +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=1709221684; cv=none; b=Qop3V5cDr1oK4gHjroLDReiRwyPdukLr5pMv0cGY6ojxewvNwQ5Np0imXre6UMCCELihJ3rbch9kQ3/Ky+9HA9eM9YxjXT+f/pn8qzH8EOqyFmMacaKpG6NMYIIPR7+dpw25udlBFxoxdC0jLSZDp62+RIB4qYa8S6teYMY8jfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709221684; c=relaxed/simple; bh=70x9FaZb7eaNHHGA2X6zEO7ykIH+n9GJcs73CL5eOGk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NFdD8upOpEw7AtwBcMkrm2i94T/eRZwQT1YzVJ90XnxWD8ZWVTRj/qS8B/msnvRAWvrtXN4tHVRQHLuXPRb0hWkmcfTGJXyDsUJ/ztXImtSBXEed6MXJ0q/L61+RpwWnuirfnXDjzqmi4ilSM5ouZTQUFOVnSxWk8ulO8ZgLCsI= 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 910B068D05; Thu, 29 Feb 2024 16:47:56 +0100 (CET) Date: Thu, 29 Feb 2024 16:47:56 +0100 From: Christoph Hellwig To: Michael Kelley Cc: Christoph Hellwig , Will Deacon , "linux-kernel@vger.kernel.org" , Petr Tesarik , "kernel-team@android.com" , "iommu@lists.linux.dev" , Marek Szyprowski , Robin Murphy , Dexuan Cui , Nicolin Chen Subject: Re: [PATCH v5 6/6] swiotlb: Remove pointless stride adjustment for allocations >= PAGE_SIZE Message-ID: <20240229154756.GA10137@lst.de> References: <20240228133930.15400-1-will@kernel.org> <20240228133930.15400-7-will@kernel.org> <20240229133346.GA7177@lst.de> 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: User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Feb 29, 2024 at 03:44:11PM +0000, Michael Kelley wrote: > Any thoughts on how that historical behavior should apply if > the DMA min_align_mask is non-zero, or the alloc_align_mask > parameter to swiotbl_tbl_map_single() is non-zero? As currently > used, alloc_align_mask is page aligned if the IOMMU granule is > >= PAGE_SIZE. But a non-zero min_align_mask could mandate > returning a buffer that is not page aligned. Perhaps do the > historical behavior only if alloc_align_mask and min_align_mask > are both zero? I think the driver setting min_align_mask is a clear indicator that the driver requested a specific alignment and the defaults don't apply. For swiotbl_tbl_map_single as used by dma-iommu I'd have to tak a closer look at how it is used.