From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 D0D64383326 for ; Fri, 19 Jun 2026 13:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781875022; cv=none; b=NNSGj60C8HFm2obHhf2c7KYroO6lI8BtM97++d3VB+kPkDOG5L7fNqic8b6V7q5Eedqpyb+cC58QU3Ih3W9tgsN9MQEHeVH6q1ysNenGm2Xs5QSaVbx8FErVmIi9paZ2zD9QdU4jhwjex+gPxsfakN9wmHmsV8Qw67ANXIz6ABE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781875022; c=relaxed/simple; bh=d74VuPv51HM6qqQdsAJpS0oOjrN6rqzlsUg+q5PK+9w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ts6wV7far9NRSChYijcLQ32TFjIp0EFZ1/NVJ9hlemO6rqgU+qiu0/UdOtcTMbA7LkZZRXJp0lJM99fjhY7wZU2SlFB2qbAGwBK2jaEdKWoJOqPoN4o/eG4PRxSsdaakV9kfKovTPJ5AjYIRotx7h1Fkm11GT91GZw2YbU2auIA= 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=Oq63Fmhw; arc=none smtp.client-ip=209.85.222.172 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="Oq63Fmhw" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-918559ee2a8so292964985a.1 for ; Fri, 19 Jun 2026 06:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1781875020; x=1782479820; 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=ejIXCVtWJLl7FRI++hzl2QTJwTEMZ8h29eav85XZ9+E=; b=Oq63FmhwZ8BFdidlsyg6EzfckItfCBcXUxP70J89HWqxxKTxj3pN+AbVGyvApwyfKh jDZgVbqvtPLRNZvF8uAwJnfHnNW5gQFicEPamcvdLyG/0YshGPHA7Mkxa7rHBGHGNwSV qPQgnwZ+lQ5+BXYHEjjhpXl/1K6iKfcj3YZrvSCZ1lW2zNDFfD3R4Q2/XohyYr4k/VrF CGQf5WvB0o/JjHFeBpfiTzOOq46K/91evBRjferI1v/TmkX0JnuITN9QHO6Twjj1zeZ4 TXlssna5A+bPyQ+x/1OKpq38h8YgViycCworEW8iRdyTxE5ar4EunVQ7xmlzVIO2ncYy ZWdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781875020; x=1782479820; 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=ejIXCVtWJLl7FRI++hzl2QTJwTEMZ8h29eav85XZ9+E=; b=T0wQTy3EnXIijY1LZGinlgy9BS7C2AdW2tLo1ockKiQZYekzckSzY8+lXZ1htqiHo/ LYQiqhb0iH8LXGqsAtGEaPnh374tlFNt+7pHYE9eZIYF/fDRmtYdPrCN0tUhGXuLGQyy L5PYqiC6tqiB/4XpKijaQiIa+nCuGnJGDj6+qfDJ1y6tKma1qBTLIn/Jb7rVYW8sTw+M vjST+Ba/Rp2fVwrKSl79CfG+hscOHej0jUkNNZ4rXSNwiIG3BOPqpLrICmHm5PPLHyqX DBqWmw4fmQau1/FYHe19oXhSEFqqlMt0OX0oQbxItDwwSKNgkM+Ln5RHtcA4PGL4dgSD iHuA== X-Forwarded-Encrypted: i=1; AFNElJ+adcz8h7JoStezTPsQ6eUPMgnhmpkdYzftz/eZWilFmz9QmSeiagjJP70mXo5hfnmAZ7V9+wewlrpdFAY=@vger.kernel.org X-Gm-Message-State: AOJu0YyuqSVxQbtLh2qT2GJWP1VaL07bKT3NO2rcB9x2IXSJ5iuhCISP O1rwQve12A5JTDa0n69j78gchd/ASVv5ngs1qV/Nx8vdHF2MnVzr73Hu6MyOdnLgUIAROu/LVsv 1dkQz X-Gm-Gg: AfdE7ckkrZUL2HpKmuumKS+VkkKUEjx4kYG/m9yuKcTUkp06lI9UwdjHPuz7xndFcOR IB6yfQLtn1/a+FhurUfVQjmOwyJTzms8Ha9qzAtdYqS+EeKamoPvryx5fLVnFlIV25t7rfq6uW1 3DhzU3u4+v1/Vn0W13CA0QWCdkGVEC0OFeYbh/xD5WjISSPTZBcFibf/BLP2gJteGwdCIf9CPZS d+bxjxV9eV0X/5T69HsCRCQTv9Mop0IVvrLcVrNCGcWzzOC3PqdZuKWj0KaNKBkIvmqZelXJ1C2 HJsUSs144gHQYyczhMQLhqBQWMJVyARbHb63JWpuM/Q1sVvTohMH+TNNd84WS+FmYnQVlGXNdqK i3H8m6Gn6XgKS9O++YddiRZjoUUOL9VG543bHd7fum4eUWZZJg45vwM46lBnvDvJXQLsw9uzDqx E7E2cEPYjmthJguqzQxFDAuqeSrczy8gQA7dzuNfpNqea58J2HNQ3ZhguJxr2A22P8JSIe2VXma 9UwUw== X-Received: by 2002:a05:620a:438a:b0:915:4211:baa1 with SMTP id af79cd13be357-9209139787bmr522382085a.33.1781875019899; Fri, 19 Jun 2026 06:16:59 -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 af79cd13be357-920a133621bsm235489985a.11.2026.06.19.06.16.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2026 06:16:59 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1waZ5e-00000004YKj-2eO9; Fri, 19 Jun 2026 10:16:58 -0300 Date: Fri, 19 Jun 2026 10:16:58 -0300 From: Jason Gunthorpe To: Lorenzo Stoakes Cc: Matthew Wilcox , Peter Xu , Alex Williamson , Anthony Pighin , linux-kernel@vger.kernel.org, Kefeng Wang , kvm@vger.kernel.org, linux-mm@kvack.org, "Liam R. Howlett" , Ryan Roberts Subject: Re: [PATCH] vfio: Request THP-aligned mmap for device fds Message-ID: <20260619131658.GA1068655@ziepe.ca> References: <20260616180129.160016-1-anthony.pighin@nokia.com> <20260616163054.77fdb61a@shazbot.org> <20260617192928.GB231643@ziepe.ca> <20260618153049.GG231643@ziepe.ca> 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: On Thu, Jun 18, 2026 at 04:56:06PM +0100, Lorenzo Stoakes wrote: > > > What you're saying is that offset 0 of the opened file might correspond > > > to a PFN that is not aligned in any way? I had assumed that when trying > > > to do the mapping of (2MB+4KiB to 64MB), that the offset specified to > > > mmap was 2MB+4KiB. But you seem to be saying that the offset in that > > > case would be 0 and someone needs to know that it corresponds to a PFN > > > that is misaligned? > > > > I do expect that the pgoff space is usually aligned to the pfn space, > > most drivers do that or could be improved to do that. There will be > > some off cases, but maybe we don't care, and VFIO should be fine. > > Some stuff has weird assumptions about pfn=0 at start of the range (DMA for > instance). Do you have a pointer? I'm drawing a blank what "dma" is? Jason