From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E192C404BFD for ; Tue, 30 Jun 2026 12:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782823133; cv=none; b=MUHy8pU0sYQCRiL0svEanJ/SibfhwOiIAFA2nJCqTwhheg+oIXJ7duPPxRNqVXKJZfRwPobd6nddFYYqTisLGk4ZqZQCzVmz2d9dBu0CBYDtquOmdHrmChRdiybrAI8qIjlaCbAAei3hYziNnl0aU6adfz3OY6lzDvnVhjUdnko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782823133; c=relaxed/simple; bh=HWLewm9KCB7MjAKi5lfHa4PConKZEGpyeTggVQfUIHk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u1fcJPTsxM8r0edxr0nR0Y0CqPzjYlUJvLwKtIbZ8tuFPoDC9Q5u8Vk74h8Cn18nIAYqM0GU2msSd5+V3bKeGS6xdd1s0pG4ewkDyzsOWHTJt2swJf1kfB6iUbSa7+bw3bdA2uc3FuHxU9uGAPnLUaQVhxQPpfT6EVTfPgNrqis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=IYD93HRg; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="IYD93HRg" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-8ea70ca4fc8so5649706d6.1 for ; Tue, 30 Jun 2026 05:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1782823131; x=1783427931; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=usbOUHulcGkq5pslDcl5tYYUADM4pc66+J0xE33qcCE=; b=IYD93HRgotQXIEA9XystXFNDgi/pIH3weHjmmw83gN3lZw1zC4MJCVTWG5/NczrUgk Wr6De8NJiNkZTRti2jUEhQPU1Ffhlh38sEIRlyNquV8m3TzXtiGQdDl7ZoWI+zjdkXwL 9KACz4Ni44wXLtMe7V3K88OeJX5dlBkAKKItgaSrfTNrTC4lKvS60D98y1+9GMxNWBgG 8z5zGajmLf/gk/yRYM4plF/h8pzzwpaZi5M6LlyaY8cINnILgPEdQpbPojtqxBIdp8Bn OLr4IzexORNiSyXOE5rwxA/Kh6S2iv9LH5FkGZMBuXqZcawbqO7+RBH/DLFzoE0zqz4B +9Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782823131; x=1783427931; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=usbOUHulcGkq5pslDcl5tYYUADM4pc66+J0xE33qcCE=; b=B5QCA25kW2czJNlT4Boq5EFmiujCGVEAw060nA7WYPQ+ogZAa7qpqZU/9yJvapWhOq axx0b5u1Ovqheh7dRhfF9sYKEhi6NW25laY3AAqezhpnsKIQurZe42TBQdzHjX2vtUDz IvUJ7NrkGWhjP16c6bS9Rcns2y5Oc91bwjxPfpfnp8+Heng6ejIwVDbb0HsJwUeweGEt GXCAy6nM9MkbkKoOLXFYFAsa/5L+Nrgemk+EuNPxSbWrLdbjR3ztFjY8S/BXBAbb9XxM 4QbdxUyuxEuGTF/pvfBT9PGSgClJDshxWqrMwISBtkeAinynoHRJHBNFrnEn8G/CyJ+M gnkQ== X-Forwarded-Encrypted: i=1; AHgh+RpiFxdsjc2jYAZ4rDAR8VuHnF+UKoVpnC7Hdy/pntkfRkdvv+gZIOiYRJs7qQVKv1TDadXmqIloDz7cMHQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyjiZ5IpLtO/2HN9DdrLNEH7eNN0zXVdAgT07QHFE4Y7ijqoYqO RlyUmEf4q8Jh63DG5AZgXp0tbmY95vPqQJnf7/2t8+tQ8JkNS8YUUo/o0W6cPJOewzA= X-Gm-Gg: AfdE7ckNKnDlcKUSZqGe37Q8m4uv9RGLEcYxXnGucwW5SCI8FF/wZNZyEfTsXqhWwlh qtM6zLzEhLKiNPKzLsA3OKhcw7ck0XGtu/zEvRULlhouJa+6bYdoT6h+OIJCiMaE1ofeV81zUO+ /cGsjdEQwePG6tNdP5kHNgwTU3C6gGeyA0HcIL8/fGNeoVfKqao/kpCZMLhELzqgrVh9YHOmVJq N3fWWjn4XQuHEIbLDclPdqhkWgf4y5bgR6UtarPDuJ23hrgsrC3lZkE2U2hsfUlMFEumhlwDX5G yourJG240N+MUWP6KUBesY9WvKsJzjUUrWbZF6jdPmPhJHEzKddAz/mmkuG3FapTJm5ZMRkTohq +5YPh6LOxXaUaTL7Szh6OYfOK0NYT/77RYkgFzPzQlVYVKmIYAL4ZbxXJsGdEg7a0sKGDnShntJ Z2fStIsey+YR/KU9OAL34FdVsfx3cWW20nhH0uP1QUAIRpjVxfe0j0qBhu3kU+/Jn3Iws= X-Received: by 2002:a05:6214:448e:b0:8db:480e:6944 with SMTP id 6a1803df08f44-8f2549e5762mr17241226d6.26.1782823130931; Tue, 30 Jun 2026 05:38:50 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f1a7558676sm22067246d6.40.2026.06.30.05.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 05:38:50 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1weXjl-00000001qLK-2mow; Tue, 30 Jun 2026 09:38:49 -0300 Date: Tue, 30 Jun 2026 09:38:49 -0300 From: Jason Gunthorpe To: David Laight Cc: David Hu , Sumit Semwal , Christian =?utf-8?B?S8O2bmln?= , Nicolin Chen , Leon Romanovsky , Kevin Tian , Ankit Agrawal , Alex Williamson , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, jmoroni@google.com, praan@google.com, kpberry@google.com, chriscli@google.com, sashiko-bot@kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] dma-buf: Split sgl into page-aligned 2G chunks Message-ID: <20260630123849.GC7525@ziepe.ca> References: <20260621222130.1667453-1-xuehaohu@google.com> <20260623015459.1153884-1-xuehaohu@google.com> <20260623094446.4a8fc2ed@pumpkin> 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: <20260623094446.4a8fc2ed@pumpkin> On Tue, Jun 23, 2026 at 09:44:46AM +0100, David Laight wrote: > On Tue, 23 Jun 2026 01:54:59 +0000 > David Hu wrote: > > > Currently, `fill_sg_entry()` splits the scatterlist using `UINT_MAX`. > > This creates a non-page-aligned DMA length (`0xFFFFFFFF`) for the > > first entry, resulting in non-page-aligned DMA addresses for all > > subsequent entries. > > There is a separate issue of whether this code is even needed at all. > Where can transfers over 2G (never mind 4G) actually come from. This is DMABUF land, you really can alocate DMABUFS of huge amounts of physical memory, VFIO does this reliably and trivially for example. It wouldn't come from the physical allocator. So yes, these scenarios need to work in this code. Jason