From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (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 DAEBF3DDDD0 for ; Mon, 10 Aug 2026 13:22:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786368168; cv=none; b=VA79BgJZhEZeEEQglCz90ZcCAaUpz8qiadpa3H35t2owpHbr9LS9vQwqO2B/DAH8aTihOHlZzAY0rcF+6Uflzdcrmsz2GbA6C1hApirjXm/ce/cUrvYgAS+fd1ty/QgZJvPc2T8MTrkMzfbD1zowlcX8FYQ9rR1JW8yKIosUFdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786368168; c=relaxed/simple; bh=QgQ3h16t1I2y58P4HYcYNeAl6wbVQDA6rb4jfsvSqvs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=T7x86XgbacgUVX1mtdi35DXyKWLqxqzkgvQ0QDhmCYjzEXbFVdE/qCt9fr4UNeGpq6AHWQjLrvNjaEz+XGbDPRBT+trksvs6acG1sdoUN7ZfxTPYAO7PQCVLOZMyskdTxR/rHi7364ppw7NB31Ui8Abv56vz6BPshF+BTBOs8OI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--tarunsahu.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gX4zsmpF; arc=none smtp.client-ip=209.85.208.71 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--tarunsahu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gX4zsmpF" Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-69abf97d53aso1780757a12.3 for ; Mon, 10 Aug 2026 06:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786368165; x=1786972965; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iM/Qa4ThtXGVoAOuESD7ZLMy4Hwa1Cb/UO9QtFpTQ7s=; b=gX4zsmpFsaLr1vGEnAU3pmgiSc5VIlJ8EHzi78YoYadPtC+xjXHFXrET9ARQvunh8U 4GmNg2eDH2SseIUkS7ciWSMVtEchs9GXxiJV0NgQ09bSMQgPdx6/va18LCgf8izxg/Cd skrEWyLVjwpH7hSc4ifLRKFoa72rpInVTZ9U6HZStig+4uXxR0Y9DV3Vc5QqDutBZTcz Cf2bD2qjeu9j8jfi0jsDtxSuifWx2goD+j//Jyyhmz482IXz9mivqzql6tOt8zv7HsCu ie/7P1yim5tC4vp+9cVqmhASNY1nPoljd3eIc/R/B2oTyiyOgjHeUoKGVcIcDO+8oBFt FwVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786368165; x=1786972965; h=content-type: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:content-type; bh=iM/Qa4ThtXGVoAOuESD7ZLMy4Hwa1Cb/UO9QtFpTQ7s=; b=shfPu4Sx3rSM2vT5QzdxseCtzyZX3cL7InN4t1jjkYJIb3f2A4Ac79cufg3WkMsk6c iumdlZLLl8hj8hcHdNYJ+7qqIznQPj32I/G3SBJdeA9Gk8ccP8/saTvQ2jYXl2zkD/up YLw1yHgsl++33qUuzIO25zZX5pWwTwOn0CtW5nZXEipSWgDI7aSYvWjx7h/dV5gB5bOy cX2vFieKSooRNyYZo7SPiCCZOscmwACflpwm/UFMujPkbtHZcBwlY9NS164bjCn8hIQE R4yyeghMj+VEkr6gjUWua1dVQJi8tqA5maih0dYUhn6NAb3FmoXDcE5oJGAQt5BXb6uO xMLQ== X-Forwarded-Encrypted: i=1; AHgh+RpKShRAK4ZHcff046Wn0tsvvA4SMFQiv0gp9WQIbxsg8W914qIWVO5fTBi4qshfSs40VdrwMfJgq5M=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7Q1dSDxoYhbKm4Hvvy/lYeb/asftP1tupczANupdyUWzTXlup vUU5Xs0NBc2T70AUnk1Ubp5IFgGgj3xqnd3Pxtn6TjGs5GdpNSWZ9yBELR8rjkleTDLPJwVbJ/0 T2lMSfMjNYe6AEIGviw== X-Received: from edap32.prod.google.com ([2002:a05:6402:5020:b0:6a0:ddb8:db7f]) (user=tarunsahu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:a5c1:20b0:6a1:f7f4:200b with SMTP id 4fb4d7f45d1cf-6a1f7f4278bmr5285938a12.12.1786368164940; Mon, 10 Aug 2026 06:22:44 -0700 (PDT) Date: Mon, 10 Aug 2026 13:22:44 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260728121138.1103610-1-tarunsahu@google.com> <20260728121138.1103610-12-tarunsahu@google.com> Message-ID: <9huzv79i6rff.fsf@tarunix.c.googlers.com> Subject: Re: [PATCH v4 11/11] KVM: selftests: Add guest_memfd_preservation_test From: tarunsahu@google.com To: Ackerley Tng , fuad.tabba@linux.dev, Andrew Morton , seanjc@google.com, dmatlack@google.com, Shuah Khan , Jonathan Corbet , david@redhat.com, Pasha Tatashin , Pratyush Yadav , sagis@google.com, Paolo Bonzini , Mike Rapoport , Alexander Graf Cc: linux-kselftest@vger.kernel.org, andre.przywara@arm.com, michael.roth@amd.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, will@kernel.org, vannapurve@google.com, maz@kernel.org, fvdl@google.com, kvm@vger.kernel.org, oliver.upton@linux.dev, kvmarm@lists.linux.dev, alexandru.elisei@arm.com, skhawaja@google.com, aneesh.kumar@kernel.org, linux-doc@vger.kernel.org, David Hildenbrand , yan.y.zhao@intel.com, kexec@lists.infradead.org, suzuki.poulose@arm.com Content-Type: text/plain; charset="UTF-8" Ackerley Tng writes: > Tarun Sahu writes: > >> Add guest_memfd_preservation_test to verify that KVM VM state and guest >> memory backed by guest_memfd are preserved across a kexec reboot via Live >> Update Orchestrator (LUO). >> >> This test includes multiple tests >> - (A) Test to preserve non-guest_memfd, non-memfd which must fail (/dev/null) >> - (B) Test to preserve guest_memfd with no INIT_SHARED flag which must fail >> - (C) Test to allocate the guest_memfd memory after preservation because >> preservation makes the guest_memfd frozen. Which must fail as well. >> - (D) Test to verify guest_memfd with INIT_SHARED flag preservation across >> kexec: Below is the details of stages in this test. >> > > I think we should split this into multiple patches, where each patch > introduces 1 test. Got it. I will split them. I thought that this test already spawn a VM and other test can just reuse the same VM. > >> >> [...snip...] >> >> +++ b/tools/testing/selftests/kvm/guest_memfd_preservation_test.c >> @@ -0,0 +1,357 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +/* >> + * Copyright (C) 2026, Google LLC. >> + * >> + * Author: Tarun Sahu >> + * >> + * Test for VM and guest_memfd preservation across kexec (Live Update) via LUO. >> + * >> + * NOTE: This is a MANUAL test and is excluded from automated CI/testing >> + * frameworks because Stage 1 daemonizes into the background to pin resources >> + * and requires a human operator to manually trigger kexec before Stage 2 >> + * is executed. Running Stage 1 automatically would leak the background daemon >> + * and cause CI runners to falsely interpret it as a passed test. >> + * > > Usually there aren't many printfs in tests, but since this is a MANUAL > test, maybe that's ok? > > Would like to know what Sean thinks of this, and printfs in general. > >> >> [...snip...] >>