From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (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 968B51FF1C7 for ; Tue, 23 Jun 2026 00:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782174153; cv=none; b=O8rhfRTF8YnavBiFdkzq2oBSCj1ujeVR0XMqk6rEE64vY1wizXCHM+OgD1Xi9Rych9wUHkdEMsHiXLDC1ny06lmPprIbYoRljdn/Lwcd0iYORzv1pYGxS9DCs/Z5DEvMqcEx4GB9o7Yy10lvKKHC4/f6nNtsJFwuYIlFgC6XzYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782174153; c=relaxed/simple; bh=hET3RaJtC6ro7NYZPXmQUq8MQF1p6emzxm3gNcm+1IE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=RviBGmMDNo75qko9uNbFedxal2qq0j2vHb3KZ3l9xb0vc197rmLKe3W9HSjS4TaKkCSJP2hSM+9CsMWbQjVdSqEc6FH+xfpGrD8i5eyPkJuug9yFU+RzKww8rBbMeMjtUgC6nDP3vr8j/QU5J+Z7vBa+F/y0JRbHjXN0m0SMLpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=QXINp+kI; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="QXINp+kI" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-8428419982eso4604260b3a.3 for ; Mon, 22 Jun 2026 17:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782174152; x=1782778952; darn=lists.linux.dev; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=oQLsIF+iVXLuEt9X7AENLYAj3zuZSbHkrs731kL+O+A=; b=QXINp+kI1Lxu0kNiF28gWcTjYviGGz4r7m6JkTStYX/X/7PoEG5ruymWoWPWFH2iFx la/6PeMmJzPuqIzmDbnMck47TGsL3dHOZBri9uKdsHW0h6RTy3Ms/zasHVxZKJgYQMlD qugI9PWDbKeUjGgt8D8uyTUy3Nn4NB8jG8bMKhsmj2Y1zSsVC+BqhlWSkqlq5ICSYocr maw9MwYacoKOFFxJhmTiPA/SRdPF4nDzi1afgSZHuU/0efERSF4en/jZcAKeY9Wd/sxs 1Et7xTvw05yQdRnMPTIflOLeicOr1HJnIXKmoMalEJtUi/nH2x6s+Y5UjBjndmBXybFB ewMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782174152; x=1782778952; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oQLsIF+iVXLuEt9X7AENLYAj3zuZSbHkrs731kL+O+A=; b=ebdw+lOT8dtCJ+eZcSQg9EYIDMdvqDIHLv8BXAdn8RPbjeQ5pKfM+7EvBqXzFwAg49 iJMHARZeojguWoJsbCcYP614g7qv1rVLugdQD1zKf7j0+ht1R9KJslZTRnvcH6H0odM6 uwJe46NJDJNxbtkP1aBBpZsBxXq4ggjqBfBzzpryoYfWb1OTQ1dvu8vqRYXsOeEDIz9P pYUNfTYqXGJ5BqgO4mmO6EAwjCgZG8R6NziSKlMEQpYQV+YKsqR91tcVa7WCX/9sq/ee B4XGl0/RFCJscDjZAKe8Hd0zrQF+5J0bppjmeeLf4D77Jb61u/AMUOtiG8sewSr+ici3 ZqXg== X-Forwarded-Encrypted: i=1; AFNElJ9Eaz1p8F7KuSIUd4mYN+pH4TNOsbFsrXVppKzi3l0Q4gIJxVJ4JuqDlNoJ2T3MI+6gojozgiENNJUw@lists.linux.dev X-Gm-Message-State: AOJu0Yy2m+Ya0yJibntXjgSmlkxyproYMEeYxnWPdzyEFmgrols/Z0oJ 7XTPG3XGsJluy+IBPNG0nMSdpsb64cpaCaF475Ks9+t6EUadUUlhSxyJVu3MSS18tIWC9ysNri7 LHg3SyA== X-Received: from pfbk14.prod.google.com ([2002:a05:6a00:b00e:b0:82f:8cba:4285]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:855:b0:842:3be7:4d55 with SMTP id d2e1a72fcca58-84597094577mr199419b3a.11.1782174151143; Mon, 22 Jun 2026 17:22:31 -0700 (PDT) Date: Mon, 22 Jun 2026 17:22:30 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260618-gmem-inplace-conversion-v8-0-9d2959357853@google.com> <20260618-gmem-inplace-conversion-v8-13-9d2959357853@google.com> Message-ID: Subject: Re: [PATCH v8 13/46] KVM: guest_memfd: Add base support for KVM_SET_MEMORY_ATTRIBUTES2 From: Sean Christopherson To: Fuad Tabba Cc: ackerleytng@google.com, 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, 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 , 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 Content-Type: text/plain; charset="us-ascii" On Fri, Jun 19, 2026, Fuad Tabba wrote: > On Fri, 19 Jun 2026 at 01:31, Ackerley Tng via B4 Relay > wrote: > > > > From: Ackerley Tng > > > > Introduce base support for KVM_SET_MEMORY_ATTRIBUTES2 in guest_memfd, which > > just updates attributes tracked by guest_memfd. > > > > Validate input fields in general. Guard usage of KVM_SET_MEMORY_ATTRIBUTES2 > > by making sure requested attributes are supported for this instance of kvm. > > > > A new KVM_SET_MEMORY_ATTRIBUTES2 is defined to support writes (unlike > > KVM_SET_MEMORY_ATTRIBUTES) in addition to reads so it can provide error > > details to userspace. This will be used in a later patch. > > > > The two ioctls use their corresponding structs with no overlap, but > > backward compatibility is baked in for future support of > > KVM_SET_MEMORY_ATTRIBUTES2 and struct kvm_memory_attributes2 in the VM > > ioctl. > > > > The process of setting memory attributes is set up such that the later half > > will not fail due to allocation. Any necessary checks are performed before > > the point of no return. > > > > Co-developed-by: Vishal Annapurve > > Signed-off-by: Vishal Annapurve > > Co-developed-by: Sean Christoperson > > Signed-off-by: Sean Christoperson > > Reviewed-by: Fuad Tabba > > Signed-off-by: Ackerley Tng > > Note sure if it's user error on my part, if I'm applying this to the > wrong base, but I found a build break here on patch 13: > kvm_gmem_invalidate_start() doesn't exist in the base tree. The > function is kvm_gmem_invalidate_begin() here. The rename > (190cc5370a8b6) landed via a different merge path and isn't an > ancestor of the stated base. > > Patches 19 and 20 have the same mismatch. Fix for all three is > s/kvm_gmem_invalidate_start/kvm_gmem_invalidate_begin/. Ya, Ackerley used a slightly older kvm/next to send the patches. I at least was testing against kvm-x86/next, which does have the rename. Other than noting that this should be applied against the current kvm/next, I don't think there's anything else to be done?