From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (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 9799138B7B4 for ; Mon, 20 Jul 2026 20:32:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784579529; cv=none; b=n0e2UGTdnHVxrq9Ac6NhWOo8QWCenWA2I7e+vvcwGlLVYUAZPsrmq78UpsguM68JvikdeEAVP2S3VKn0B++KomJ4iUXyx+3g3E/unoD62ARtwdv19gUNLDuKaDkrLkJa89l6ubl3RW9R+q0fogkKFg1b4ZPk7vquW62dlfO1g34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784579529; c=relaxed/simple; bh=M6t9sVNu0+vMRFHDNupl1agOdFvX3PfAHNxguX4HeGA=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=iEPxBPczctsL/QSItvxMXsIpxlzzkKsotpADFanQ5sWxgOvRzd5vQ3aHkt880pUlfHLnwP9G/81Tx/9NLJhBbM2a4+OsQSL3tBU9qfhET49d9Vu8lLLkSFvLwZG02djwNww0cHCOhaHsRRxn6BliaX4C+hEmj9n4Q6Y7XQEj8VM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--vipinsh.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ehwOMOTE; arc=none smtp.client-ip=209.85.216.70 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--vipinsh.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ehwOMOTE" Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38dc085b0a7so16021890a91.2 for ; Mon, 20 Jul 2026 13:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784579526; x=1785184326; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=jJ5vvKCyidYv3tyHVDhakK14swOU/I7OHGnSl6Url7Y=; b=ehwOMOTEk1XPq+CCcgIeBRY+lqc46Z5dh49FkOiKKjoBd22piM2XGDG5aHVtZAsSeQ rQqPexPIuL4XS6+0xBYaIejAB2/EtsEAW0UD6KmHn4KQtHPdwrP8WJ6n6eb3O1WVBnou 9DIaJNhJqtx71rcOzczABbni/UXUkqKzDeybDkl23TwOx+pYE60aDVvJkRgL26YKrLII 0q3fuJMpdgPrkTyD2To1JGidjyXJwOB6lAbN7hLyI94q0u/KOp16xA9HIK4uflBH168c Rat2/DNfimZDnoNehZu2PXMBwZNiHSWesl0qgQE8u7Hq+3uwdZe0UKesA7gAyYoo+Qvp Z4gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784579526; x=1785184326; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jJ5vvKCyidYv3tyHVDhakK14swOU/I7OHGnSl6Url7Y=; b=mgT/bbzeljOMFwS8GAFYYyLgf7dVGlJOscVgZoGNQzDCE7eKF4pVmjPQT2lqpZRblf +tagQuN5UDiZXHZA2O4e3n3oqTIDYMFGuH/8VL5DaD+Tdbr0zcXk8MWzdIsOlH4GCKRq 01dFSWQnXFl4P/pSF15VlBf0wtU6+Ff24VGG0FRCrg99J5cOSL7aCF6OkqBhU8Y6n43Z cR0sUipgxTdSSBNFqAFQbLP8QPrk4boqr33lmI5XDn4c75DE/oGadjDD3VgbV6a8IIGS 57WIM0SIYnnthqdzpdhBcb7msESIbMVvIxgZwUmLEGfkOTKLW+xpxz11BNFCuI0i1HKE p3jQ== X-Forwarded-Encrypted: i=1; AHgh+RoB5ppJITUnU/7RTLlPFGqgNW6j9mdBhrSP7+1yD3PLRIqWhJOrBTB+5agfdtbJdZ7TPOOd2KVLDUzpEzk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz2+WUPfpTkIJC6B7qSSy2OuspUDwBWxFBLCMWr7avOQGJpZJ9S ejPQoFZx5oJ48tPKS3B8zRrc7Uno+vCBczpQRChN3Us+Y3cKT3swBpz2sE3VXRNKti2jGkzOgWi 9u2P3kjODBA== X-Received: from pjrx20.prod.google.com ([2002:a17:90a:bc94:b0:38e:42f5:d097]) (user=vipinsh job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1844:b0:381:cef1:11b0 with SMTP id 98e67ed59e1d1-38e4b55af0emr16557704a91.33.1784579525644; Mon, 20 Jul 2026 13:32:05 -0700 (PDT) Date: Mon, 20 Jul 2026 13:32:00 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog Message-ID: <20260720203202.1964557-1-vipinsh@google.com> Subject: [PATCH v4 0/2] Make liveupdate selftests library From: Vipin Sharma To: pasha.tatashin@soleen.com, rppt@kernel.org, pratyush@kernel.org Cc: tarunsahu@google.com, skhawaja@google.com, shuah@kernel.org, dmatlack@google.com, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-kselftest@vger.kernel.org, Vipin Sharma Content-Type: text/plain; charset="UTF-8" Hello, This is v4 series of refactoring liveupdate selftests as a library. It exposes common liveupdate ioctls as a library which can be used by other selftests like VFIO and IOMMU. Currently, there are no users of this change but it is being used in VFIO and iommu liveupdate series. VFIO: https://lore.kernel.org/kvm/20260714151505.3466855-1-vipinsh@google.com/ IOMMU: https://lore.kernel.org/linux-iommu/20260614233728.2212104-1-skhawaja@google.com/ I think it is better to move the patches out from the above series and propose them as a separate series for inclusion in liveupdate repo. That way we can decouple multiple downstream dependencies and then it can be used by VFIO, IOMMU, and KVM (guest_memfd preservation) separately. v4: - Rebased on latest liveupdate git repo. - Update luo util path in newly added vm_tesh.sh script. v3: https://lore.kernel.org/kexec/20260612214512.464146-1-vipinsh@google.com - Renamed liveupdate.c in the library to lu_utils.c - Reordered patches, first abstract out ioctls to utils file then create libary. - Using stricter check for ioctls. - Reordered header include, also, keeping c lib headers as a separate block. v2: https://lore.kernel.org/kexec/20260610230909.876546-1-vipinsh@google.com/ - Addressed Sashiko feedback regarding folder creation. https://sashiko.dev/#/patchset/20260511201155.1488670-1-vipinsh%40google.com - Update liveupdate.c test to use ioctl wrappers in library v1: https://lore.kernel.org/all/20260511201155.1488670-1-vipinsh@google.com/ Vipin Sharma (2): selftests/liveupdate: Use luo_test_utils.c for liveupdate ioctl APIs selftests/liveupdate: Move luo_test_utils.* into a reusable library tools/testing/selftests/liveupdate/.gitignore | 1 + tools/testing/selftests/liveupdate/Makefile | 14 +-- .../include/libliveupdate.h} | 11 +- .../selftests/liveupdate/lib/libliveupdate.mk | 20 ++++ .../{luo_test_utils.c => lib/lu_utils.c} | 63 +++++++++-- .../testing/selftests/liveupdate/liveupdate.c | 106 +++++------------- .../selftests/liveupdate/luo_kexec_simple.c | 2 +- .../selftests/liveupdate/luo_multi_session.c | 2 +- .../selftests/liveupdate/luo_stress_files.c | 3 +- .../liveupdate/luo_stress_sessions.c | 3 +- tools/testing/selftests/liveupdate/vmtest.sh | 4 +- 11 files changed, 122 insertions(+), 107 deletions(-) rename tools/testing/selftests/liveupdate/{luo_test_utils.h => lib/include/libliveupdate.h} (77%) create mode 100644 tools/testing/selftests/liveupdate/lib/libliveupdate.mk rename tools/testing/selftests/liveupdate/{luo_test_utils.c => lib/lu_utils.c} (83%) base-commit: e9089cc16239725330e8e8a5748face3b8e995b7 -- 2.55.0.229.g6434b31f56-goog