From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 6603A1FAF for ; Thu, 18 Jan 2024 01:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705542782; cv=none; b=BQOr06o5uw7a/PHOGnMsAm29ugf0KY/j4cShyIM0SkFK9Cx0UaFpvxBxfjH5U6VLUL2G8FS8t/LVIAhOAQXf1N9Hj0IRrzWwq+cGeJkU1IAOZdAueYXtqLnEIWeDkdmfKvOC5tx37S7Kh/0l4Ky1jCOQDN/o48y7/LgiK0d0stg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705542782; c=relaxed/simple; bh=TbGKo9XwnaWFRnDaGJQYGEDB3n+mODCRkk1sjg7BuRA=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:Content-Transfer-Encoding:User-Agent:MIME-Version; b=NofbQcXb/ap3kGIcwQqT8wJ8pKRWh+6uSJx+wrP6mHoMjJPjcVRsXhkS23M9axXLEpx7ssl4ZrQv8l9oNWN5oGGHdXibKfvupUT9eYUYG0YQxjHyrQ0we9qzgn0ozapgtonDx8ZT7G9AKQRgvvfFEORbdr0EAP969J8kLhoNWJo= 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=W3m259+Y; arc=none smtp.client-ip=209.85.208.169 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="W3m259+Y" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2cdc1af60b2so45958221fa.1 for ; Wed, 17 Jan 2024 17:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1705542778; x=1706147578; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=taCIpUJqzL+JyTaiMa3v4bP+c2WFVuuQ9gZ9COs9zu8=; b=W3m259+YmlnMuOAK6XKKmaoxzp5GGgx3fAtvpII5LF5lLztUFbWKPSw4hN78NgVby3 kT5w/VsyaCVOv4qT5OnPO8r0Gevcgxl91/k89Z9nY9E0r9Qfj/23hwnb+577gamTuwiY 4fpYgw+oVNniaB63cN/ZK8SclF6Ph3RZBkLdrn/AGFDwUj2cOuzkoxrNnpHBfhSUKrUc jgnK75bXS2guTzpXzDVKqgDemgPEnQ/jYPT6EuoF9/FdybTtSmzis6tdW7Joia7XjPJo F7e2HN73aiFt8eMRng1P5FYZfsj3wvMhWbiKfY4nqnbkw8bgI+reT1IVF9Nx4AjxkBN8 WWvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705542778; x=1706147578; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=taCIpUJqzL+JyTaiMa3v4bP+c2WFVuuQ9gZ9COs9zu8=; b=lZBMIxKX0BpL6L2sjJ3GBEeyLPUV1WDLOd8KBEGyvJDcl02YxfQEiwPQaiIOzZwMcc DlhHX6O3KsorObW18YH870mWa4lnWFX4osiS4r7oep8LkoYeGhsZBKmzmrs5ocqvEcGa ADIEl6dmV0q2e/G8ug2+USQRDIsyByE3Orc3FbaRg03/5Mgbf0aFxgFZ2vBkoCZg+rdY YHU3zp8wr384PFuE3Wy7hIynrX9SiLiC2c2YERioH7GMb85oa0Ic5bCWUtxsYM7muOX+ EcrysnI3F25mbaAGgyafrcV4/zP3xBR6EAf1ePQQ1vSFGBbT0GwRTu0c+HBaNiKgPRmC 8aiQ== X-Gm-Message-State: AOJu0Yy175XrmrAT2IAhJE36CFAvLrPzneiiDNydDtYMx5GaVhzRuZL3 HxU6H21DLe3yrrtRNmie2uVNm01ZVFnQh2GZgZJzrKRijbzyIGeR25vKHHMGCEU= X-Google-Smtp-Source: AGHT+IGvzTuyC7iVwlQOSofeR6dJpAULy5A1d7eEifJUQAx27DALwNdCqveNkTX/dJSr0C9xl0HxDg== X-Received: by 2002:a2e:9050:0:b0:2cc:a7b9:2fa0 with SMTP id n16-20020a2e9050000000b002cca7b92fa0mr66494ljg.12.1705542778479; Wed, 17 Jan 2024 17:52:58 -0800 (PST) Received: from ?IPv6:2804:30c:974:ac00:1b02:e2fd:23be:79bc? ([2804:30c:974:ac00:1b02:e2fd:23be:79bc]) by smtp.gmail.com with ESMTPSA id y2-20020a63e242000000b005cd78f13608sm338946pgj.13.2024.01.17.17.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 17:52:58 -0800 (PST) Message-ID: <4aaa05fb405e921f25c907ca09ea29976ca0707c.camel@suse.com> Subject: Re: [PATCH v6 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch From: mpdesouza@suse.com To: Alexander Gordeev Cc: Shuah Khan , Jonathan Corbet , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, live-patching@vger.kernel.org Date: Wed, 17 Jan 2024 22:52:51 -0300 In-Reply-To: References: <20240112-send-lp-kselftests-v6-0-79f3e9a46717@suse.com> <20240112-send-lp-kselftests-v6-2-79f3e9a46717@suse.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.1 Precedence: bulk X-Mailing-List: live-patching@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2024-01-17 at 16:40 +0100, Alexander Gordeev wrote: > On Fri, Jan 12, 2024 at 02:43:51PM -0300, Marcos Paulo de Souza > wrote: >=20 > Hi Marcos! Hello! >=20 > > Having the modules being built as out-of-modules requires changing > > the > > currently used 'modprobe' by 'insmod' and adapt the test scripts > > that > > check for the kernel message buffer. >=20 > Please, correct me if I am wrong, but with this change one would > require a configured build environment and kernel tree that matches > running kernel in order to run tests. Is that correct? You don't need a kernel tree in order to run the tests, you can build the modules and use gen_tar to pack them, setting KDIR to the currently built kernel: make KDIR=3D$(pwd) TARGETS=3Dlivepatch -C tools/testing/selftests This can be used when packaging the tests, like Joe showed when reviewing the v4: mkdir /tmp/test-install make KDIR=3D$(pwd) INSTALL_PATH=3D/tmp/test-install TARGETS=3Dlivepatch -C tools/testing/selftests install In this case /tmp/test-install will contain the scripts and the modules compiled targeting the same kernel version from the kernel built from the kernel tree. You can also run the tests from the kernel tree but targeting your currently running system. Using this approach you can run the tests on machines without kernel tree and without build environment. You can also pick the kernel source and run make kselftest TARGETS=3Dlivepatch As KDIR wasn't set it builds the livepatch test modules targeting /lib/modules/=20 > Thanks!