Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2448694lqb; Mon, 27 May 2024 23:06:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpTfXyCfnyedJjFTRhhJiUQg1WDB4yN0TbOZumMuC7ih1S0B9/mznH+w5xidiQL2sZ00p2+QulNa7AyKDZLpSurtQoNN1FaHwz/MaVfg== X-Google-Smtp-Source: AGHT+IH2Evn/3c/vbuWIEZYPMQP3d6I2fDpxGwliKgXSypf2qYCwsyc0vWq8PxURct3spIa0Fh2d X-Received: by 2002:a05:6358:9107:b0:194:80bd:3e8c with SMTP id e5c5f4694b2df-197e50ca46dmr1546211355d.4.1716876394375; Mon, 27 May 2024 23:06:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716876394; cv=pass; d=google.com; s=arc-20160816; b=lilBqVhUcquCdjICAAVXgMU3raHGeXid5a4Hbm/1Vdu9Ka2uZtdHMvwugyKn7U/OAD 6XJZlZriqDkQAPoQIjYxiIEtJabQtblTWgUF5KQBCBUUxk5FP5Rz+cE3ama5Fvvho/z5 3DXljxDu7sHZQBTrWVJh/rt60BsvW31gXaQeaU42y/72ZKwUR1AhOT6Y2KCE7wHHrRSy gYSHOHjLj49Yn1DJRWaPCL9oD+yhiAtNM9p68yCWkK+QwW2CEecS+Tl731JQoQd0tbOE zsqwpOQJ7Vmo0jCGEl4KymScwcIpHaKTC5kCeNPZ6JIWomDJ1PbePXsJeDaQGMVvtN1E Z13A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0CXyIaSIcIvnhOrbj4/tTeYYvOeXhTqPwtR91rJKVIU=; fh=JxiVGwBJ2Ug8TGkXR20t2sJ46wq3FxiOsfNfPgiZ7Bs=; b=GbeywH4zIaDOCPzibJX/Me5agKg8ETWtHQG1DoCb83CNYMfY63c+i+KZFlLof+RWfZ 8YkDgq6Z9ak1zfs6Iqut51IkidxNj9b6f05ZvXdLLWN3sCdTHqLCzC6JTmjGOrb+6aRs VNs0Z/DoWk2eIc2PxlaJnLEnPOBDCj7/28z2DqIPTMPH7IAZ0K4W9Fqt00LKxhW/ZqBo vIpbtXjLoaxLU2OVYKVJvzJ/p5xJby0akodYCOdLQyQN62GTvPQCYWlHpow1n11AeyPA d+laRsMGJMEOA3OTiYCdLGXFUx8hj6z7llCgw3Jc5lsMAEoMYcMKUjEP/qw6U19PfvIN oDyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=l0CfYHgZ; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-191741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191741-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68eefb59290si5965064a12.40.2024.05.27.23.06.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 23:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=l0CfYHgZ; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-191741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191741-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 4FCF2B2209E for ; Tue, 28 May 2024 04:49:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B32D7199B9; Tue, 28 May 2024 04:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="l0CfYHgZ" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 EABF4645; Tue, 28 May 2024 04:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716871753; cv=none; b=SjNueZXEGZcwhP7WG/edLPv1UlqBHPR47wOavRgg2z3v+E2iQHazg9GKp6PkEP9S024HgIrCXBi44iY4qaB6JIuGrcbcH4/ffSIvWNjn0tEWbR3xF9+NMqJNRqfx1iQASXlribK+AtPW9M63zfxpXUMnBxUPMaA3A9ScQzWPFrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716871753; c=relaxed/simple; bh=0CXyIaSIcIvnhOrbj4/tTeYYvOeXhTqPwtR91rJKVIU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NmjD+762buPVXViXjquTFXI2C8HBfkPZlTHd1dHphGnlFIEiZIcwMzJwAb5Hty5FIuT422nbdF9cdsYvxwm+xCorlax8nxN2GlVpzZLdxbEhiPGJnBGG2VbtmMiha4t94qNpjSJVDH7McLOSFWJmDKpQ4kfl1ASNCeC0N/5pqjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=l0CfYHgZ; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0CXyIaSIcIvnhOrbj4/tTeYYvOeXhTqPwtR91rJKVIU=; b=l0CfYHgZ++0RNk4PInLN8d0CXI GNzaT0t8lzt32fgjXz6YWL3RANfr0ij1Ioyd3HHtKFI6G+Ex7s85Dl8e7NaO1A9CqLOtHPsUvqsrk e4TeSYYVQwrMm40AX34Yn6u1DDN+i3vpiB9ujt+btOIsDl1IB7o/MxSwDJte1TCeOqwRLq5UXQ6k5 XciOO2G2jPlUupVWPtg1SYpfdJQ5hAkPOwV9lKTfLSbe50nRYJ0jUGUBj34Pdi+ZFyqSum3LS7gEE EcWvpwEheCY7G7gA7bU86rzdfCFH30U55LCdOghGpv8she29FPSIWmGDUIfbKAy7P9y4feBBoeYb0 GSIo3plg==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBoln-0000000H3Db-1Xow; Tue, 28 May 2024 04:49:07 +0000 Date: Mon, 27 May 2024 21:49:07 -0700 From: Christoph Hellwig To: Andy Shevchenko Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Robin Murphy , Joerg Roedel , Will Deacon , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado Subject: Re: [PATCH v1 1/1] iommu/dma: Make SG mapping and syncing robust against empty tables Message-ID: References: <20240527232625.462045-1-andriy.shevchenko@linux.intel.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: <20240527232625.462045-1-andriy.shevchenko@linux.intel.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, May 28, 2024 at 02:26:25AM +0300, Andy Shevchenko wrote: > Statistically there are only a few cases in the kernel that do such a > check. However, any attempt to make it alinged with the rest 99%+ cases > will be a regression due to above mentioned relatively recent change. > Instead of asking a caller to perform the checks, just return status quo > to SG mapping and syncing callbacks, so they won't crash on > uninitialised SG list. This is not a valid use of the API, please fix the callers instead.