From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 4BC7C24291A for ; Fri, 16 May 2025 13:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747400995; cv=none; b=JNvqjksdx8908yCSCAKphPQ6ttuWi0QSBndryfv1SGHTHdplQHL+r+PgXPdv4MI+kAWubocRdWuhq92dPpRypOYTpVq1N2dqdNW/u+ruCSKo3BvqyCIsmaZTfvgVSijY5DRG6YRHYW3BM6VlPsiu48r+OMppUIhgcxRPSB/44Jg= 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.219.46 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-qv1-f46.google.com with SMTP id 6a1803df08f44-6f6e398767eso41461946d6.1 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=iheZsq52gb2ED7l5XkUffeM202TNNZPBa5nHTorkmxi+NHQkl0hjGHZcGKBgqgH/vQ w64u0u106NQc++m+IlZ2VXSqLSvczKw1jMjicWgOzGwzCo24Q1dJocUsL4cgjUL5IN1n QeIR3O3BIQDR05lNU5idRcpRsT7S0V5RBiV1cW1AylF3O05HqBqHdlFv0O+qhPJLVZw1 c4tMPb08c2Hmdt8c9Qa0EcXV40s8VP8mP1or+2gpxh3kWKX8sjVDr6CqaxYvJdlIWoMQ 08mXG2dJ5XlG3wZpv3C4Kh67lbfoTGGarwRAbT9se7OWUx4kRuMQ87UxuoF26YcMWxuo IN2A== X-Forwarded-Encrypted: i=1; AJvYcCXxfdpTXr1/bSnGMK+xEboh3/PtzhuBF25JZPMX/3g+OaIqiGLR8kT++l1vOSUqYxnKcuw=@vger.kernel.org X-Gm-Message-State: AOJu0YzeG/N+IXQr9cgiu22SMfvK38g++ofx2fLSfhJSt13BTcecjBpT rIMlySqF12QyZ2yUYTvCrTq/PG5Ks9RGqkS2zRBe1/irgD7ZpXEoxCsSpwcdbYL/LVE= X-Gm-Gg: ASbGnctsRmOK0oDHhbIYdUFf3ei3GN1r5olNYfEl/uxkJm37hsNtgRJzGjp3N9qgaQA R7HsMGOE3g/IFxrjeVdKs77Dxtu72SZtZqS1MpAAWw/bvs43AAchsZIVl/mVmIG29M0RjS3T1fK 0ZNL5qWUHv9LG5XW+tmIJtMI+9On3M4ZFHfFmEGtMzkpqSo0aGIpQ58cytjZvy7t1VRUXkPfKh4 eMl3FDiaQuh/ocKpSSklkk5ejavW+Z44wlJ300okybkQF/B7kGrFEHPV6HMSjc0xVLxK58GHIPX P7WaJZ5Pd0AukrgB5FfTxvUm2khUHlGkMxWCR8beV0GH6ENZVQHtRA3k+ENXOv3pw3TIPsn3taV buHm8Gy5vfpcQ/YLFu7pUhCkBOEM= 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: kvm@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