From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j5WBXzog" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C93D7B9 for ; Wed, 29 Nov 2023 23:32:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701329537; x=1732865537; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=MhyNAN59jGiFlQny5EFhPJfUBE5/214AnRgM0gfUD0o=; b=j5WBXzogVcAUxHRRcH2/AhTUzMVGU+i0SPm+4yr52BDLohVxOCVtNbcy n13OrWzKR5HXcp/rKhD0GdgQEeBNVgRKE2CgHEJf+Pk+Q1bmPwzz+7D97 Y+nPdkmSpJNDaqG/i48dIfWO7tyixrFxCA8WYuEGr27O6gxd0hdz5USzs do57LInADPDq3s+dM2BvjrRfQpM+ObmLVBXMVNggVNy6lADrSejokr7xm 3cmQqitIEZ7EZu81vZ8lVit7HRWgLR3l5tzPbmMdQer8Av9MpHJJrLLgR GPYBGpSGf6bCRcjktWEuuE4OIFn+kXhrtmfGHyZN1ChRrLcHcv71CIZw4 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="479484332" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="479484332" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 23:32:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="769202097" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="769202097" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.93.29.154]) ([10.93.29.154]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 23:32:10 -0800 Message-ID: <4708c33a-bb8d-484e-ac7b-b7e8d3ed445a@intel.com> Date: Thu, 30 Nov 2023 15:32:08 +0800 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 03/70] RAMBlock/guest_memfd: Enable KVM_GUEST_MEMFD_ALLOW_HUGEPAGE Content-Language: en-US To: David Hildenbrand , Paolo Bonzini , Igor Mammedov , "Michael S . Tsirkin" , Marcel Apfelbaum , Richard Henderson , Peter Xu , =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , =?UTF-8?Q?Daniel_P_=2E_Berrang=C3=A9?= , Eric Blake , Markus Armbruster , Marcelo Tosatti Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Michael Roth , Sean Christopherson , Claudio Fontana , Gerd Hoffmann , Isaku Yamahata , Chenyi Qiang References: <20231115071519.2864957-1-xiaoyao.li@intel.com> <20231115071519.2864957-4-xiaoyao.li@intel.com> <05f0e440-36a2-4d3a-8caa-842b34e50dce@intel.com> <0fbfc413-7c74-4b2a-bade-6f3f04ca82c2@redhat.com> From: Xiaoyao Li In-Reply-To: <0fbfc413-7c74-4b2a-bade-6f3f04ca82c2@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/20/2023 5:26 PM, David Hildenbrand wrote: > >>> ... did you shamelessly copy that from hw/virtio/virtio-mem.c ? ;) >> >> Get caught. >> >>> This should be factored out into a common helper. >> >> Sure, will do it in next version. > > Factor it out in a separate patch. Then, this patch is get small that > you can just squash it into #2. > > And my comment regarding "flags = 0" to patch #2 does no longer apply :) > I see. But it depends on if KVM_GUEST_MEMFD_ALLOW_HUGEPAGE will appear together with initial guest memfd in linux (hopefully 6.8) https://lore.kernel.org/all/CABgObfa=DH7FySBviF63OS9sVog_wt-AqYgtUAGKqnY5Bizivw@mail.gmail.com/ If like Paolo committed, no KVM_GUEST_MEMFD_ALLOW_HUGEPAGE in initial merge, I will go simplify Patch #2. Otherwise factor out a common function to get hugepage size as you suggested. Thanks!