From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 D7A9C3D091B for ; Mon, 30 Mar 2026 13:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774878543; cv=none; b=qRY+BhTGvjV2bNmMW+9m/EI5h9dJ0/vCy7tHmUmXWhzl7W0oZEBHKGfRPIVSLGsI8wm9iyHsppRszIIAr0pzW29SHU4H/CVFww6jGB6CYNzL4K05RsG3ZkwjQ+QbCtynygWd2oA6MWsBufKxSSzDJU8nEn/6ndQ0ppoSX7AI//I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774878543; c=relaxed/simple; bh=XkO1wPeal3Kc8w275PiOatPBzgWgLU7yfkQaxOpKYzc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YkTo9dJzUI5Yr+P7jH9Ni3lFUfDjDmsT9N6aijeW8TrY+4ZL9vlE79kS9sX3A3vbSKzfAY7YEWQS6VcqqoNltL5OxjWE++pfZ98QOEaaUOY8+ErxWQsVpS3gp0yecYPnbt9/nvAyx8BzOcldHq2f1odpYe02R6SS37bvvb2gj1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=TbpTuWxO; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="TbpTuWxO" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4853c1ca73aso45198525e9.2 for ; Mon, 30 Mar 2026 06:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774878540; x=1775483340; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=njb2j7pkbXogpjPTY38oH4qSs8U+jP8c+JG2E4esAKs=; b=TbpTuWxOaP7Qwz4V808ahKSugVmVHWlAewXrKDlL9/zCSgoT1pwiw8jC2n7KQNEjkX ps6dedA0Yh2KPCDci4Germ0jpWVGqhTsh5+Ut78tADMczfThh+LYUH6anHaX5ly0JAWK E7ESwQmpQMav9kFpCXsAhSOOvBJ+eQweYwog0NKkpG6Dtx4/nHg080OUedMg+/jUkTMj REhl3yJVgta6UmP8hCjYSosKrRwZy35i2UFFQ7UrroSSwqeJ9cz1w2XqYnhxqiSfone5 dRNqtpSyn9bGrI3P6jV6gjCCY11ZzhFSA9QRIqtjb0rs/xylnyhsN7IXWPxS+UmUFIsU aKlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774878540; x=1775483340; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=njb2j7pkbXogpjPTY38oH4qSs8U+jP8c+JG2E4esAKs=; b=UaYBOG1KIsZPQa2ZHTC31VIqSicvet+lDjIL1Lt4XXJWDPrsq+Wg2gV7HoOM9rc/NA 8X5aQTatvXRd3+daVQlhuC62vuv/H8dSlKO+WzMKudEFCHUn9sJEQZCJA7UYUCV28Klf x0+sS+ldOQBrZG3OB9qYGH5Ok8GjM/EzeDCvdt3fq738sstpcQKvxwI0aS4dTZt5DJ5E 0vsjKDNJn9e2LpUAPHrRY51FT8CnBxVq3BtCvxX06Ax8qI6ytTga+TamT3ru/lRD90KN p9RweSw3qyP5V+rPyjNUNumArGgDljSjspJTUWAlTKHQmEZPPFOAEDI83qwuNaqKG/MS EX1Q== X-Forwarded-Encrypted: i=1; AJvYcCWn/1GJ42kxWc9WpJ1T4fGs44dU2Fpn7X4qhrWa4GWBC+rJEmhDrFAQnKFnN4q6IW8pE7u8Gp7C5W2KGFE=@vger.kernel.org X-Gm-Message-State: AOJu0YwLn3jheDd8mbvHEAojbFws6yCTX9wdt4tK/QaiqPyBwsrX41fI DOHaZLTqbTfc96W6DwsrBOP6bYw8y0Gxo9hIsCzUR0Cd+SqmyZc2bsJTMQTm3rfxkiQ= X-Gm-Gg: ATEYQzw3PQSakbFzhZyeJ6kE7MznONvjQXGdAVQOezXjPFycKR7GmO6ekXnaTO0WRpL xblyX40CVZlSPiqd9/oa1H4SHTvtav0KmF8EG2NMbBmEItU0zg0HAWHFsvBLeU1aTjwHZG4fxah RBFGY+LYRE5X5HNZgOLDsG21z2Ve0/lh5G4KRDcD/L22FKqf3We+mLpzprO4hUOQbeWAbyfmhiW OzJlhe5nX5MF6lUsE4qrODAriBzvYyY8e8Gqagj1zfnbzA6g3ZRfxl22uENz5keCNSotSrlpiae AIXq/CJDK/vKkSCn3WnLYC5oqaUi+rtHJqFmqeqbefk5xBuIBxlNUGp4jNw9w56R94df2GjHZZb Tq3/XdZH/jlJlIvaw8IQ0hXenQBvQPcENtl7gBpeEEFRP4IWu8oibVhZDOWJhMu1vQFOr/zSA/N /XOeO8LxvTzYo2/z5439nTIMvWuQ== X-Received: by 2002:a05:600c:4744:b0:485:2a4b:7bc3 with SMTP id 5b1f17b1804b1-48727d5d6femr207566795e9.4.1774878540187; Mon, 30 Mar 2026 06:49:00 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48730628efasm297363515e9.5.2026.03.30.06.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 06:48:59 -0700 (PDT) Date: Mon, 30 Mar 2026 15:48:57 +0200 From: Petr Mladek To: Joe Lawrence Cc: Pablo Hugen , live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz, shuah@kernel.org Subject: speaker-test-module: Re: [PATCH] selftests/livepatch: add test for module function patching Message-ID: References: <20260320201135.1203992-1-phugen@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu 2026-03-26 16:41:02, Joe Lawrence wrote: > On Thu, Mar 26, 2026 at 03:34:36PM +0100, Petr Mladek wrote: > > On Fri 2026-03-20 17:11:17, Pablo Hugen wrote: > > > From: Pablo Alessandro Santos Hugen > > In my RFC, I created a helper module which implemented a person > > (speaker) which would come on the stage and welcome the audience. > > I am not sure if it was a good idea. But it became a bit confusing > > when everything (module name, sysfs interface, function name, message) > > included the same strings like (livepatch, callback, shadow_var). > > > > Anyway, my tests produced messages like these: > > > > +% cat $SYSFS_MODULE_DIR/$MOD_TARGET/parameters/welcome > > +$MOD_TARGET: speaker_welcome: Hello, World! > > > > , see https://lore.kernel.org/all/20250115082431.5550-9-pmladek@suse.com/ > > > > > > There were even tests which blocked the transition. They tested shadow > > variables which added an applause to the message. They did something like: > > > > > > All four callbacks are used as follows: > > > > + pre_patch() allocates a shadow variable with a string and fills > > it with "[]". > > + post_patch() fills the string with "[APPLAUSE]". > > + pre_unpatch() reverts the string back to "[]". > > + post_unpatch() releases the shadow variable. > > > > The welcome message printed by the livepatched function allows us to > > distinguish between the transition and the completed transition. > > Specifically, the speaker's welcome message appears as: > > > > + Not patched system: "Hello, World!" > > + Transition (unpatched task): "[] Hello, World!" > > + Transition (patched task): "[] Ladies and gentlemen, ..." > > + Patched system: "[APPLAUSE] Ladies and gentlemen, ..." > > > > > > , see https://lore.kernel.org/all/20250115082431.5550-11-pmladek@suse.com/ > > > > Sigh, I have done many changes in the tests for v1. But they still > > need some love (and rebasing) for sending. > > > > If these can be pulled out independently from the v1 patch, perhaps > Pablo would want to hack on that in a follow up series? Unfortunately, the selftest changes can't be pulled out easily. The new test module and related livepatches are implemented using the reworked livepatch API. :-/ I hope that I'll find time to work on it rather sooner than later. Best Regards, Petr