From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.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 921B930100D for ; Fri, 29 May 2026 13:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780063064; cv=none; b=s6cz0ka/HFS8EUt615GcJ3eS8asT497zPoUXHXVNAQNY/UhuAo4hLLKhBy7wt1dGDYS/GPlGWhrurYcb6grExrxR+tbhYFpgd37T612nrsWqfuMgdetxmODendb35W0dz5+02aCpC+ox7lCCUtmsWuvOIx1A7aC7wqB29LTOY14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780063064; c=relaxed/simple; bh=5r7hAYNnwpIZ4xzhnNtWnoBK5uuHAAboWtkxjCjNLKg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=krgjTLF8DGGUcO/II04iLWuPToeeIALpVTqkdfkMbPJ76dRD7bVrcA5V6sskuBJXz/thw20RneRDKMbv76XR7JA7Od39AbVaBodFxnHjuV+P29P5xzngkFocnYs3hAdNv1vXdorWW4/m1TJKTu0w9BWGEEHolaURVi4PPrVbqz0= 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=cujidW4N; arc=none smtp.client-ip=209.85.215.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="cujidW4N" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c85759a8f33so490395a12.0 for ; Fri, 29 May 2026 06:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780063063; x=1780667863; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=x7V3EuRCYlsfPg0omB2BiXVnJ9x4bOVCssFd+7Pw8f4=; b=cujidW4NT2B/UJuaouuVMsv1yTO7Q+iLn9Wxk1l4cED9zrgsxGJyaAEHTFMBiLaPoV j+n896mOeExGkEjbhyS7qQgyraWpSO2HqF900hhQrgBw1FV2Iz/QrJPa1Dhi5azNpDo1 hnY1CkGbozm3uqTehIPeBF29lUMy3MkmUqirj0t7NT64CjqKqqv6fJIl18zuwmqShfV3 bYi8NR1PLpp43o1SH4ogK5aoZTWg+BSKaR+7iRJDhom9ERLuS5wFnmSaNZNbtO8BvUtw 2VnrSNeg7rY8nRFa+0ANAGpV049wiT9ax5c94mdpbp9avAqfIXbHhBX3JALUn7nVSW/E sjng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780063063; x=1780667863; 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=x7V3EuRCYlsfPg0omB2BiXVnJ9x4bOVCssFd+7Pw8f4=; b=K48YW7c/M7dCj08nD/enBE1xxdZnG3yOK7vIbpe7sVFcMh4NXg0BnVN+mEtj04qflF thCBfqZb490o7RQjADAbcK/kSHuxS6H6RoSlr0nhP4KAf+mrXDVNS+XRbFnH3ZDnqXDu 49f4Hk1AsY97FRRRhvr4XLn0PEPnaZj4vX4Iq0mv9ADqO31h2k/yAMXUOLm4GVeUuAyn id3VrLKM6w5CVuEU2P5NtrOJwa511b+nk3GoywWbGNBAW3uC2pNWgkn+NhlaUSIerER/ XjHt2zksDrdMhxO9TvPSydVXwklBuSTCQGKPye42yxOPTNbM6t8F6WYfTNLjZYV15KrV HrPQ== X-Forwarded-Encrypted: i=1; AFNElJ8lBspdMbg7TWg5skdTCN/ojKcmDS36Q8VSagR9jamrpkXcBtFZZdGmyITue1wF7tnitX5jKVtkklh8mWs=@vger.kernel.org X-Gm-Message-State: AOJu0YzC4akf2MK8fOp/lGMVaCZthtUwBtwOzcDh/WX5RYMtXaVjPF0e nc4O12C6iQ2JSm1n04URixeEcWbfQVHB7htbgjMERLKxSlGoIFcJbNfSlASTKTf87b+qQztF5Of McCT9rg== X-Received: from pgc20.prod.google.com ([2002:a05:6a02:2f94:b0:c82:2d72:ac91]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:9186:b0:39f:3559:750d with SMTP id adf61e73a8af0-3b40fd77806mr3582072637.31.1780063062497; Fri, 29 May 2026 06:57:42 -0700 (PDT) Date: Fri, 29 May 2026 06:57:41 -0700 In-Reply-To: <9huzwlwnbgdd.fsf@tarunix.c.googlers.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <9huzwlwnbgdd.fsf@tarunix.c.googlers.com> Message-ID: Subject: Re: [RFC PATCH v1 0/8] liveupdate: kvm: Guest_memfd preservation From: Sean Christopherson To: tarunsahu@google.com Cc: axelrasmussen@google.com, mark.rutland@arm.com, skhawaja@google.com, Mike Rapoport , sagis@google.com, Jason Gunthorpe , Shuah Khan , ackerleytng@google.com, corbet@lwn.net, dmatlack@google.com, Paolo Bonzini , Andrew Morton , vannapurve@google.com, Pratyush Yadav , david@redhat.com, aneesh.kumar@kernel.org, vipinsh@google.com, Alexander Graf , David Hildenbrand , Pasha Tatashin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, May 28, 2026, tarunsahu@google.com wrote: > 3. No need to preserve kvm->mem_attr_array, as this is on deprecating > path and For this series, where only fully shared guest_memfd is > supported for liveupdate, preservation of these attributes not > required. > > Due to time constraints: > we have one open Question left: > 1. How to check guest_memfd is fully shared. Currently that is being > done by INIT_SHARED flag. But with in-place it is going to change > its meaning and it will mean only durng the creation of guest_memfd > it is shared whose folios can be converted to private. > So for this series, I am looking for suggestion, what is the best way > to find the sharedness of guest_memfd which will be compatible with > in-place series. OR we can go like this (my personnel recommendation): > > if (guest_memfd_is_fully_shared()) > return true; // support the preservation > > // This series > int guest_memfd_is_fully_shared(void) { > if (guest_memfd->flags & GUEST_MEMFD_FLAG_INIT_SHARED) > return true; > return false; > } > > TO:: > // Once in-place conversion series lands. > int guest_memfd_is_fully_shared(void) { > if (No Private flags in (guest_memfd->attributes)) > return true; > return false; > } Given that lack of support isn't going to be limited to _just_ guest_memfd, simply disallow preservation if the VM supports private memory: if (kvm_arch_has_private_mem(kvm)) return -EOPNOTSUPP;