From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 794863ACEE9 for ; Tue, 4 Aug 2026 02:11:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785809491; cv=none; b=m2i+ZiCndpbNP4eerMHBZleA3hHa+tey/IiPXL5/CUgjrIuaAyaWHCjBk3/k7ZyNm6Z/SDMkcA7YNdzIgqHPrhecn4wjDs+xuMNG++rLziKFqngbMoh5s/mbOD7cz4Np4uu6ovgmMl9c1JNrtZXfEUDSw+C8uVvCi22L4BL6Mf4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785809491; c=relaxed/simple; bh=B+nmhdc2wKhIJIpBwW+MwyfYVUtbdARoiSCqxXo6ddg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QXfIxxc6jXV3AW8ajytFEktCWv8qSxmmCWSFaF4UWZkPlQWpAeqtINIPxBz3xhSAoN/T02W0zQ5dg+E5N4jDNLIHFQ+jAPY08YooXJtLGTuhT2+M9+nxrIuadusqpliiW0DLtNXk5Y6bK7JPiEH+an6i4w1yUkgyQs0WUVuu7J8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=E9Z9a3GF; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="E9Z9a3GF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1785809487; x=1817345487; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=B+nmhdc2wKhIJIpBwW+MwyfYVUtbdARoiSCqxXo6ddg=; b=E9Z9a3GF44HOQGtBDSuUkLr+yAiYSZ7KE5dA9c0APHpnKHhVLBbBHSMd OqvyaFmtwGfpILziaR8/8BEBknVZ56PQkCPTuSUiPUV6zeoLfli/cDBvv W5oUCqCERSMRW4/zgp0JSsFEYHgeT1ugsitklr4mkWQgVPxevVBSCeUSn 6mDcqTja7dyLDGSYRo/TFAWQUgvR1ryHDh9JvlNu0zCfJ6y1it5j3k6Wp a/osqc0znkmgryPToRy9uOl0/Rq4xiyMJBREwRxP3TFLSBDdFLBIl+0jA QUzZVoMdlekzQkBBM3J7Bfx3/AW9ozg277kycQaq5lpj6dWXEZJ4kDNBy g==; X-CSE-ConnectionGUID: E9RA5AUlTeS2+YU0XZWLzQ== X-CSE-MsgGUID: eqoC/tCKTDOl5+XzGAb/Ew== X-IronPort-AV: E=McAfee;i="6800,10657,11864"; a="86121604" X-IronPort-AV: E=Sophos;i="6.25,203,1779174000"; d="scan'208";a="86121604" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2026 19:11:25 -0700 X-CSE-ConnectionGUID: KUMwzY9FTRiSU0SR1Bn47g== X-CSE-MsgGUID: U8Dg8g26SGOUT5Pc2eda4A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,203,1779174000"; d="scan'208";a="266494953" Received: from fuxiaogu-mobl1.ccr.corp.intel.com (HELO [10.238.208.47]) ([10.238.208.47]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2026 19:11:07 -0700 Message-ID: Date: Tue, 4 Aug 2026 10:11:05 +0800 Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 07/41] KVM: guest_memfd: Wire up core private/shared attribute interfaces To: Sean Christopherson Cc: Ackerley Tng , aik@amd.com, andrew.jones@linux.dev, binbin.wu@linux.intel.com, brauner@kernel.org, chao.p.peng@linux.intel.com, david@kernel.org, jmattson@google.com, jthoughton@google.com, michael.roth@amd.com, oupton@kernel.org, pankaj.gupta@amd.com, qperret@google.com, rick.p.edgecombe@intel.com, rientjes@google.com, shivankg@amd.com, steven.price@arm.com, tabba@google.com, willy@infradead.org, wyihan@google.com, yan.y.zhao@intel.com, forkloop@google.com, pratyush@kernel.org, suzuki.poulose@arm.com, aneesh.kumar@kernel.org, liam@infradead.org, Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Jonathan Corbet , Shuah Khan , Shuah Khan , Vishal Annapurve , Andrew Morton , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Youngjun Park , Qi Zheng , Shakeel Butt , Kiryl Shutsemau , Baoquan He , Jason Gunthorpe , John Hubbard , Peter Xu , Vlastimil Babka , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev References: <20260728-gmem-inplace-conversion-v9-0-35f9aec2aed2@google.com> <20260728-gmem-inplace-conversion-v9-7-35f9aec2aed2@google.com> <60d19013-d6d7-4eec-827a-2622e22cec98@intel.com> <25ab36cf-888a-4547-b3f7-5bd4e057c1d0@intel.com> Content-Language: en-US From: Xiaoyao Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/3/2026 11:33 PM, Sean Christopherson wrote: > On Mon, Aug 03, 2026, Xiaoyao Li wrote: >> On 8/1/2026 12:26 AM, Sean Christopherson wrote: >>> On Fri, Jul 31, 2026, Xiaoyao Li wrote: >>>> On 7/31/2026 4:42 AM, Ackerley Tng wrote: >>>> If kvm_range_is_private() is useful/required by huge page support, then let >>>> the huge page series to introduce it. It has nothing to do with the in-place >>>> conversion series. >>> >>> If it weren't for the fact that the range-based search is used later in this >>> series, I would 100% agree with Xiaoyao. >>> But since the core logic is used and needed elsewhere, >> >> I don't see it a problem. Without introducing kvm_range_is_private() in this >> patch, the core logic of range-based search on gmem can still be introduced >> as kvm_gmem_range_has_attributes() directly in patch 10 or in a separate >> patch. >> >>> and because kvm_range_has_vm_memory_attributes() takes a range, my vote is >>> to provide the plumbing now, even though a small portion of it isn't >>> strictly necessary. >> >> So my initial feedback was "we can just use kvm_mem_is_private(kvm, gfn)". >> It makes code simpler. > > My apologies, I hadn't actually applied v9 to look at the full context. I agree, > providing kvm_range_is_private() is completely unnecessary. It's not even really > a problem with this patch, it's a pre-existing issue that can and should be > addressed with a prep patch. yea, that's why I said "it seems can be a separate patch. " >> And as a bonus, the logic to choose between gmem-based attribute query and >> vm-based attribute query is hidden from the static call. > > I don't follow. What do you mean by "hidden from the static call?" The whole > point of using a static call is to select between gmem-based and vm-based private > memory. Or are you saying the populate() flow doesn't need to manually check > gmem_in_place_conversion? yea. By using kvm_mem_is_private(), we don't need the kvm_range_is_private() introduced by this patch, which has the gmem_in_place_conversion check. >> The second bonus of dropping kvm_range_is_private() is that we can eliminate >> one more chunk in patch 20. > > Ya. > > Untested, but unless I'm missing something, patches 6 and 7 of this series can > be replaced with the attached patches (6 and 7 should be squashed together no > matter what). The attached patches are just what I wanted. They look good!