From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB86EC5AD49 for ; Sun, 8 Jun 2025 16:48:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CD9A6B0088; Sun, 8 Jun 2025 12:48:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AB776B0089; Sun, 8 Jun 2025 12:48:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56F2B6B008A; Sun, 8 Jun 2025 12:48:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3917C6B0088 for ; Sun, 8 Jun 2025 12:48:01 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AEDFE101CBB for ; Sun, 8 Jun 2025 16:48:00 +0000 (UTC) X-FDA: 83532815520.08.B5F95C2 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf26.hostedemail.com (Postfix) with ESMTP id D443C140005 for ; Sun, 8 Jun 2025 16:47:58 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=0ryGVGC1; spf=pass (imf26.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749401278; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z4mLD6ZBDCacy+5KKbwWASUNAXTCWi/82rv4+F3m5es=; b=O3yie/7Gzs/cINZXVW2Xfg+HyzSKdS6KeLbUnSrodaN5/k8ROt5L9vBiaTntWGiSDTuPXs wK1FzndMgM1FkwZaWxEQDYWmswrHV2xQSdA3n/TdvS45PZtV3vMGRdkXMR7AxmEk6rMYMT /8ikh6HkzucoCwTSUHaQO6siFAHqWQw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=0ryGVGC1; spf=pass (imf26.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749401278; a=rsa-sha256; cv=none; b=4KturgwkI7Iheej3A5eqHmb6EI2KeUWF2E0gWwBQ+KZaFoCW1hDfI4cJXiJchLEgsUAaWj hkg3dtaMR9hBbmPha/ZCao+V54TM30TyA1RdrUcARbuKpEzt0Ra29IwsXgm+LSs9PYLma/ 1U0mootzV8K6KHOpKrtO/4JYJyKow8Y= Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7d20f79a00dso489248785a.0 for ; Sun, 08 Jun 2025 09:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1749401278; x=1750006078; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Z4mLD6ZBDCacy+5KKbwWASUNAXTCWi/82rv4+F3m5es=; b=0ryGVGC1CSvt10Q0BrFMJoyOyMuV7bL8P3mcoWoUB9uEo8PtYCtwVKbHvoHKkUmpSZ 0vpZby5TevxU4nMzpBrnMXQw+vf/LPDbvf8swolVJFgEGi98s1XB0uIqs3Us0SaDxx3g JCgOgwpPX1ZsKDWXaOcJtwX32OQL9KLf47QSyRhIIGdvQB06hRpqLVECdPvqVgpMdPUe xDjDWXW3m84L9Dab0p9bD4emD7L57bY/imRp3iH1Trq4qn4UHXVvZ6WIQszcirTaRgx7 /IHC1LH3qwQqJHE2GLp3wHszXH5BsvuhKR/Ls82yG5+4fHKJqb723+sUeJmUxHQ7RQoJ yIoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749401278; x=1750006078; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z4mLD6ZBDCacy+5KKbwWASUNAXTCWi/82rv4+F3m5es=; b=Zgszu21X21g3NXcxzevYhI3RJYqmOYE6Ok4xCJsIsSp8DbB9fDv0JgyypQTjdrjJRW HKaNprkEy/uvZrObLysz76oRxGnNdGezTDT9NOzZ5x3lE4ABtmQ2MRnPZrDkO4Fni6gr AAPwn6y7RuxQ2Z4zBroUb/FmYNL9tUdF3MF6l/GxEjHLmBItqzyhE+r2DqmNEXoW1mdj jf1nKK92gBn3NVF4yANDZ37r47CY+LQvYuJQOYubZnCWmpNS+83FLEJPPyL+JAmBnPCU UlDY1gEunzP2EyVBstrvwGXyJFEvtVVJbmm5l/SjcAoWfcVrqy331+X3+oWC8PP4gT3x eUgA== X-Forwarded-Encrypted: i=1; AJvYcCUHXf+Nd+RBXdoDnTjNruMJDjc1f+EMucTqy9nnVINODI7SJvLwuVrO5/hcLXvS9INvs9cACr5ydQ==@kvack.org X-Gm-Message-State: AOJu0Yy47qhK0tn7rsQBFX70doX+8S/SKhxAmN7ud6EOoWbYLFiTc7Ca 9JRCx5DQ0nvq27q72FQwmWtG/4IVbl7HYZAxdyxx89PXV9ZhKAzr6/LQs7PTB/A4XYG6xF1ijHs 4BVB9cIIR6HiMdcqTgrEnxAUEHY4d2wr6RX0qtXyh3w== X-Gm-Gg: ASbGncuC/tXNYMXuBY7MLg3kxqjJv1R8YxzY0R6tYGZ/MnyBETZX6amdYPheFreT39A DCXdnmAWK/kl8EowSS2Z2czCTdNl8kT6MYrCVSU8T83iKF3ME5WJasft3F0h2S3QiYCPeBDUj0I 1p66jYii2pJzWC/RzCHZZmrCk+rjH/ZxHwT4hCguQP X-Google-Smtp-Source: AGHT+IEs/C9sBlNWz2wXNsGbPqskhgwVgo/QLWX02D5Sf9R590oESJfie1k8PTRBskdNsn7eCrILFqcX6T3swqr/wZA= X-Received: by 2002:a05:622a:260b:b0:48e:9e05:cede with SMTP id d75a77b69052e-4a5b9dc4512mr199150681cf.52.1749401277864; Sun, 08 Jun 2025 09:47:57 -0700 (PDT) MIME-Version: 1.0 References: <20250515182322.117840-1-pasha.tatashin@soleen.com> <20250515182322.117840-14-pasha.tatashin@soleen.com> In-Reply-To: From: Pasha Tatashin Date: Sun, 8 Jun 2025 12:47:21 -0400 X-Gm-Features: AX0GCFtdRr0JczX7XZvcuUGFk7aKkG5txkDs_LzBQs6_5QSoVZeflqKUSwLoHnM Message-ID: Subject: Re: [RFC v2 13/16] luo: add selftests for subsystems un/registration To: Mike Rapoport Cc: pratyush@kernel.org, jasonmiu@google.com, graf@amazon.com, changyuanl@google.com, dmatlack@google.com, rientjes@google.com, corbet@lwn.net, rdunlap@infradead.org, ilpo.jarvinen@linux.intel.com, kanie@linux.alibaba.com, ojeda@kernel.org, aliceryhl@google.com, masahiroy@kernel.org, akpm@linux-foundation.org, tj@kernel.org, yoann.congal@smile.fr, mmaurer@google.com, roman.gushchin@linux.dev, chenridong@huawei.com, axboe@kernel.dk, mark.rutland@arm.com, jannh@google.com, vincent.guittot@linaro.org, hannes@cmpxchg.org, dan.j.williams@intel.com, david@redhat.com, joel.granados@kernel.org, rostedt@goodmis.org, anna.schumaker@oracle.com, song@kernel.org, zhangguopeng@kylinos.cn, linux@weissschuh.net, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, gregkh@linuxfoundation.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rafael@kernel.org, dakr@kernel.org, bartosz.golaszewski@linaro.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, yesanishhere@gmail.com, Jonathan.Cameron@huawei.com, quic_zijuhu@quicinc.com, aleksander.lobakin@intel.com, ira.weiny@intel.com, andriy.shevchenko@linux.intel.com, leon@kernel.org, lukas@wunner.de, bhelgaas@google.com, wagi@kernel.org, djeffery@redhat.com, stuart.w.hayes@gmail.com, ptyadav@amazon.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: D443C140005 X-Rspamd-Server: rspam09 X-Stat-Signature: 6u49cpe9kmyg6cak5zj9xhafne3j9ara X-HE-Tag: 1749401278-583389 X-HE-Meta: U2FsdGVkX19L9DtIAYL7IwoiTB535uYSo1zBRDiVGT1ZdsEgxB/XBy9CH54MJ2lIdpI53FRe0r/j3MDTxwPplGyti5XKpVuGAIsIIY573eAk+V/DOw4A00FQ9JYzMBY9Anuywh9kSNbeYXAUvIiY98Ejcc2iV8uqw5ATDCKwTTYYMGAk96aZPKF2Z95JEAbfOSuohCDEdMiXLkFHEF4rojD19zRiU/sIKLQAnS8+MsVhs0uQp5WiD8fJd9ZpZuB2+Jwdwz0/urZswXZb4fBsawjk7CcQPyV35XEAVqIVCxna6ZOREBzUjCoosh4CSjFcfBCwTxRrfK/bzT577bYpPVoGRNoF5MdG94T5ugvfz9VGXpgaj5dwTgKGDLVWIXLSlRILhDSb0lFm7JD4mwmuFtjZ3LaQIjKHR+AIbZCtCD5xpf3087uw3AZTBMFuMBKrdKKhIDm9sdsAW/ZFC83OWX/efXFsmMeScJgzRSRPueE9/GBE6gqSi2x0ZYyJBqmJ7RI8a0PiM7IF+nIv3bjRDTNKpSLHxKoSME7JKfoMC6qRiBlO97GRcLCFzQWg5wcFSPukGf5nCuPYtXeN6iypfww6n+Ka2jaRQdD2pLMHhMfI8CVAULYq/DaAE2HvrITSrSuUWQXp4/5ywcrxY/62wTVhIfe0OeyuVvdQajpnzOHqAon+q6momYYgSQG1WqrP7Qu0dujjBkm3+muv0gAQPbpTd1szUJxqN/bPc2ycXrJQ25BonzbSY+X1VcFF/7IUX5Bbp03ITQ8Exhs/n6b07G+tJczRggD8KqwLp5SaZ6EVFdcGACvtWxpLyivFqVI0I9xSr6c+4RhROTMilVqQpdK1fesBJTX7jE6Y/cogHG7PHUNILuEZrK6wviI8r6TYAQVwOMkEPOubCl/p90LMsdsPXnEWvACxcNS3hBiBfJrrbFQOCaO3ETazn/4/Mz0GdiauNK8fr5OCXuJxLA3 4QEpiYnY hjVBXNEenuEKtt6ZQk6kFz0PHCx46nbEERLKotAUx4GkpuLZIxtSdq+/kZ2KvHhYROo/lXOeGVAtTIydqawgP+QlMYSN43mt9OZScxEivSUBYc/IhwNfsEBUKfK4XnqHdVnEmevdGvG51G9TV521VmG5vZPoYyKXYJBo/17hzfm7wBiqrW0aUy+Sr74BF7XashySKq5EAyr6pHC5no0zFEfTMJ6VyX2X6Ss76O5jKnpIqD3okJ998sElycc6ZM8NU+TimxcNs8ac5THLO/G6hkQakTV7CCmaB75n30qiW4XgxEdzbhkpPtmCoPKGl/hfE3tD2LOMHEQEoO8XyDWOtbniBGA4Ht3L4pvxK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, May 26, 2025 at 4:52=E2=80=AFAM Mike Rapoport wro= te: > > On Thu, May 15, 2025 at 06:23:17PM +0000, Pasha Tatashin wrote: > > Introduce a self-test mechanism for the LUO to allow verification of > > core subsystem management functionality. This is primarily intended > > for developers and system integrators validating the live update > > feature. > > > > The tests are enabled via the new Kconfig option > > CONFIG_LIVEUPDATE_SELFTESTS (default 'n') and are triggered through > > a new ioctl command, LIVEUPDATE_IOCTL_SELFTESTS, added to the > > /dev/liveupdate device node. > > > > This ioctl accepts commands defined in luo_selftests.h to: > > - LUO_CMD_SUBSYSTEM_REGISTER: Creates and registers a dummy LUO > > subsystem using the liveupdate_register_subsystem() function. It > > allocates a data page and copies initial data from userspace. > > - LUO_CMD_SUBSYSTEM_UNREGISTER: Unregisters the specified dummy > > subsystem using the liveupdate_unregister_subsystem() function and > > cleans up associated test resources. > > - LUO_CMD_SUBSYSTEM_GETDATA: Copies the data page associated with a > > registered test subsystem back to userspace, allowing verification of > > data potentially modified or preserved by test callbacks. > > This provides a way to test the fundamental registration and > > unregistration flows within the LUO framework from userspace without > > requiring a full live update sequence. > > I don't think ioctl for selftest is a good idea. > Can't we test register/unregister and state machine transitions with kuni= t? > > And have a separate test module that registers as a subsystem, preserves > it's state and then verifies the state after the reboot. This will requir= e > running qemu and qemu usage in tools/testing is a mess right now, but > still. Normally, I would agree with you, but LUO is special as it has two parts: user states and kernel states, and it is already driven through ioctl() interface to do state transitions, and preservation management. So, in this particular case having an extended IOCTLs to configure a specific kernel state, and then use normal IOCTLs to drive tests is very useful. In the future, I plan to add support to QEMU, but we need more work for that to happen. Pasha