From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (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 4C5AC242922 for ; Fri, 16 May 2025 13:09:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747400995; cv=none; b=o0g0cELKe4YK4yJF64mYe9Fwk8cMlLGXGsYY2cAMArk/6tygtXWmLtKQmNkKXt0KCNxavwBcjDsdIuia/zpiBq88Hp44TdeZhkO1KFACJReFlWm6G4SUvfmmlMkUqeEGJGqYYep9O3V/VqvZygfvBhwr3QdWpXngip6grSAWKC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747400995; c=relaxed/simple; bh=KeeqOAOGD2IxZktca9/VQWKsKkXiMamtPhRfiYyinBE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HgeQedNJBG9IXbrdauV/lAtgiO6/ywCzdSWh9lHgnQ54qzhKkoXSucPkGVk5u5RqoJzE54GKkQnMOhVdd08+uDufFQ/9FIIqu1TdvcSsLutYPozU+PIuWL267b/AFUdJ3cBFXj58HLp1x2mXviF6jkIvRU1KG++b5LErRQAKAa0= 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=N6aK/QuY; arc=none smtp.client-ip=209.85.160.178 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="N6aK/QuY" Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-4775ccf3e56so37417771cf.0 for ; Fri, 16 May 2025 06:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1747400992; x=1748005792; 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=WBkLgz+xs0k99ZNtnJXNN8FdEZvlmytfCxgniwbp1fs=; b=N6aK/QuY/aBobCo1Y4KMAlQpboDW2ZkhOjnQiPxpwYCo2C2bv6G8pjpvI0U/VcV07w iKB09xqesGfk4M6naEJuR1tunrC8xRT+7uep7DXRuSCMl6ZOm3A2gfeSb3vEKLgTRUg8 5ZlxHh5YFlQv7hEjd/NmrY2ARqArwsl6gwVNVL5PltoCKzHr/ORWfZ8ka358rMgNj7aM OltfMFww5Ut6y7lVyx8RmlSvsK0w06CwEDq+tCa2pjdHBdfMDNb175TnD4DMR6K7aySs 7kZajIY4nzaVqxY6+s/76B+eZxXWAo7Wkr+6ShiQZVyazb1P82zoWstqXwNSU9oMlzzy OZyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747400992; x=1748005792; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WBkLgz+xs0k99ZNtnJXNN8FdEZvlmytfCxgniwbp1fs=; b=lMUpAF+ZQAs4wKPu3C/ypKM5Px3qCXQpEhgjqTh/d0tCZB5+zG+gGMPqGu53h4ZvAr fi2ZyNd5VllUo4oZ2ScJq30zH4RUvKhD7VxOnJ1L4rpxqx/jEEJpX4OAOMTMzfuyr29W JhQG75Eqi9H/A7DBQ3svHI1uehxtdrgr+m2JjUD2fzflfPuGsxXPbOO0ra3iXHidHTUO tUfLlRC66Hd4WdtTcmFLGRW/G1oPvYr8tjdb/CKL0rm8Y6u0GbQY6OJOoZE6yT/Lkpk+ c724cuIZqdCihmVLqnAPLwopRk89LkIAWVO0q0n9bWpDZE1CWID2oOYA2r1gvqB7Qy06 ABNw== X-Forwarded-Encrypted: i=1; AJvYcCUsw7f4oEewGoLx9Xtp2aSLQrCiOhez91cf8SOwXRDryun+bngfR6v8e7HKIgjwe+HV4KLlNZjpstN8b57W@vger.kernel.org X-Gm-Message-State: AOJu0YxMxQeh/KyWVG6Lq06l0bZuuSy/o5fQ9Q8YdcQ/bv4LG+ZyNkNN tJTfgh2s7bhRUdJp+dmZXMDPPauyC0YNYrR3j1Zu6MgUysrBlA2l4CCoTvAOLeHzKi8= X-Gm-Gg: ASbGncsiBjX/ZtCbojF9s3j6xz+EerMY7lW6T6tFnSehQ7FYkqqCYsa1ysTRr8Zqe3D 5kyi4akE/5CWtaB1r1sr5uoI9zrfM9VfkHlxW/Hwp+Oow10Zo/1KsnjO6zUM1QCGDzqF3BJyK2H SPD6z31BRbmAXOyCQ3D9hmdVpkF7evqM2b5vZOlZQnLjWT//p3Jn83hsk8y7zr0K/KjnxSdz0Im 5zmtDYb8He4+50LtAHHg7U4eKUJyNj9rELuHhPHhoSIj1Bb+yeK7PM97G3KuDgtOJT2WjR7K70n alG0g/M36CwVuKTtov8jkUYt4DpMx9Cs2Q39GwE7ixx+nQX9CgY3OGw0plc4JtzryY61QzM833Z 9Vd/3POghdsk9p6x9vsZFUFdGQtA= X-Google-Smtp-Source: AGHT+IHPCApkxTW848mw2pAvy0O37cjq5r1nPCJEjsfJzIZSF+v0PF+8hsJhAhsmje7cLGzcj8IimA== X-Received: by 2002:a05:6214:2428:b0:6e2:4da9:4e2d with SMTP id 6a1803df08f44-6f8b124984bmr51931186d6.9.1747400991725; Fri, 16 May 2025 06:09:51 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-167-56-70.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.167.56.70]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f8b097a59fsm11761186d6.102.2025.05.16.06.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 May 2025 06:09:50 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1uFuow-00000002fSS-05ik; Fri, 16 May 2025 10:09:50 -0300 Date: Fri, 16 May 2025 10:09:50 -0300 From: Jason Gunthorpe To: Sean Christopherson Cc: Rick P Edgecombe , Vishal Annapurve , "palmer@dabbelt.com" , "kvm@vger.kernel.org" , "catalin.marinas@arm.com" , Jun Miao , "nsaenz@amazon.es" , "pdurrant@amazon.co.uk" , "vbabka@suse.cz" , "peterx@redhat.com" , "x86@kernel.org" , "tabba@google.com" , "keirf@google.com" , "quic_svaddagi@quicinc.com" , "amoorthy@google.com" , "pvorel@suse.cz" , "quic_eberman@quicinc.com" , "mail@maciej.szmigiero.name" , "vkuznets@redhat.com" , "anthony.yznaga@oracle.com" , Wei W Wang , "jack@suse.cz" , Maciej Wieczor-Retman , Yan Y Zhao , Dave Hansen , "ajones@ventanamicro.com" , "paul.walmsley@sifive.com" , "quic_mnalajal@quicinc.com" , "aik@amd.com" , "usama.arif@bytedance.com" , "willy@infradead.org" , "rppt@kernel.org" , "bfoster@redhat.com" , "quic_cvanscha@quicinc.com" , Fan Du , "fvdl@google.com" , "linux-kernel@vger.kernel.org" , "thomas.lendacky@amd.com" , "mic@digikod.net" , "oliver.upton@linux.dev" , "akpm@linux-foundation.org" , "steven.price@arm.com" , "muchun.song@linux.dev" , "binbin.wu@linux.intel.com" , Zhiquan1 Li , "rientjes@google.com" , "mpe@ellerman.id.au" , Erdem Aktas , "david@redhat.com" , "hughd@google.com" , Haibo1 Xu , "jhubbard@nvidia.com" , "anup@brainfault.org" , "maz@kernel.org" , Isaku Yamahata , "jthoughton@google.com" , "steven.sistare@oracle.com" , "jarkko@kernel.org" , "quic_pheragu@quicinc.com" , Kirill Shutemov , "chenhuacai@kernel.org" , Kai Huang , "shuah@kernel.org" , "dwmw@amazon.co.uk" , "pankaj.gupta@amd.com" , Chao Peng , "nikunj@amd.com" , Alexander Graf , "viro@zeniv.linux.org.uk" , "pbonzini@redhat.com" , "yuzenghui@huawei.com" , "jroedel@suse.de" , "suzuki.poulose@arm.com" , "jgowans@amazon.com" , Yilun Xu , "liam.merwick@oracle.com" , "michael.roth@amd.com" , "quic_tsoni@quicinc.com" , "richard.weiyang@gmail.com" , Ira Weiny , "aou@eecs.berkeley.edu" , Xiaoyao Li , "qperret@google.com" , "kent.overstreet@linux.dev" , "dmatlack@google.com" , "james.morse@arm.com" , "brauner@kernel.org" , "roypat@amazon.co.uk" , "ackerleytng@google.com" , "linux-fsdevel@vger.kernel.org" , "pgonda@google.com" , "quic_pderrin@quicinc.com" , "linux-mm@kvack.org" , "will@kernel.org" , "hch@infradead.org" Subject: Re: [RFC PATCH v2 00/51] 1G page support for guest_memfd Message-ID: <20250516130950.GA530183@ziepe.ca> References: <24e8ae7483d0fada8d5042f9cd5598573ca8f1c5.camel@intel.com> Precedence: bulk X-Mailing-List: linux-fsdevel@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, May 15, 2025 at 05:57:57PM -0700, Sean Christopherson wrote: > You're conflating two different things. guest_memfd allocating and managing > 1GiB physical pages, and KVM mapping memory into the guest at 1GiB/2MiB > granularity. Allocating memory in 1GiB chunks is useful even if KVM can only > map memory into the guest using 4KiB pages. Even if KVM is limited to 4K the IOMMU might not be - alot of these workloads have a heavy IO component and we need the iommu to perform well too. Frankly, I don't think there should be objection to making memory more contiguous. There is alot of data that this always brings wins somewhere for someone. > The longer term goal of guest_memfd is to make it suitable for backing all VMs, > hence Vishal's "Non-CoCo VMs" comment. Yes, some of this is useful for TDX, but > we (and others) want to use guest_memfd for far more than just CoCo VMs. And > for non-CoCo VMs, 1GiB hugepages are mandatory for various workloads. Yes, even from an iommu perspective with 2D translation we need to have the 1G pages from the S2 resident in the IOTLB or performance falls off a cliff. Jason