From patchwork Wed Feb 21 17:17:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 204329 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1177830dyc; Wed, 21 Feb 2024 09:18:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUzQ6AkvtZGv4E5zDd4hhAYW7j7L71IFhHelmzeXUOhEWyd3qMdgovqorM/kcdyV1QE5OoMos7l/BHnlJMI/2U//3iOXw== X-Google-Smtp-Source: AGHT+IHPbJxltF4jRMgT4Se+I16Zm35zfS8Uyp7A4ZSiyJve36573ioL7IWWgJwxjJ1BgLpQmUM5 X-Received: by 2002:ac8:5ad3:0:b0:42d:b5fd:3fca with SMTP id d19-20020ac85ad3000000b0042db5fd3fcamr18576460qtd.31.1708535910768; Wed, 21 Feb 2024 09:18:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708535910; cv=pass; d=google.com; s=arc-20160816; b=GuMaRjqG2Bpp4u3lChjMfndrLuj+3Fohtrbhq0lGtOZz3Fh5iMGbobDrKl0G6IPekJ SqJbRYqkAEffGpQMsfrxTfuDjt/fI33MkmDsTn7u/mUvJCbLd8fQyku/ZUhFqPOaF5ua 4MlIA4y647z2Nk5TkFlsyT2+ps5tDJ7qnoIAIlVwyER+IpkBLhhBAlNO7J9RY0zu+JvB n553+BsTWOMKdhJmh9J4E1t69L9P3ai27KtPqoKZIRkUsetwwOKks86/evj+c01WV/ea uUUoTuie15rZqUErzZRBWho62vR40mDdhM/DncD5EyumuWwLd5jCcMczINqN73KcngPp GDTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=ON+H4nmacUr4cyiEil/PadlFM7I5maC8v2ckPj+6x7I=; fh=oGTeheTGtJi/O2KL90xHksAdkswU33tM/8rayu80xMU=; b=FD+bykWo8MHHKfBmp8hrLfjx8ExrJGz87Xod/lrGPUzOCEC3lKsoi4CoJOYNsnJdt0 pY+2IVAMYfOOU4dHZ+zgCK0IXWP1rxSsf3lr81mDC0Jk+V0f4SLtfjhRO6f601RY+SX9 Xf/lgcxMtWmVzF79aXf01UqesnMYOt7cq40HPSUj8s0zBKG6cvPQc+OzjtUuG7q+OzFX HEIXrKN27/S2pS2BKSc3WfQ5bBsVvUSgU0SX0J9IP6mtcWvGqBByDps/CWYnJRcJsZc5 /IJIrsmADZ8HXGCjSGrl5nHzNio2WlbI0QpTEK7g1gBcBSZptZKXs/ehKxqxIITOWCRh C4TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75182-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75182-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t37-20020a05622a182500b0042df052451bsi11611299qtc.172.2024.02.21.09.18.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:18:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75182-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75182-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75182-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 884891C22E20 for ; Wed, 21 Feb 2024 17:18:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B336483CCD; Wed, 21 Feb 2024 17:17:21 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 93CB885279; Wed, 21 Feb 2024 17:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535840; cv=none; b=tXM7sigWilkTLjSJwMysqJPjFHkXpQ/BSacHUvtihJJB8mAgre47ixm/sHkChJPpmPomJo7Hi8FU4FF8gNKh5HiX4dFhwo5TQ0THAN4CBqG3puzr5xZfpRx3OZEsmK/X+f4ehIhOoFzU76oBLY/I4lg3INnWIEahoLrDkUg1Ing= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535840; c=relaxed/simple; bh=mobHejLyMa9lwd2koRFuFHd/TN2Lj+Tpf18ZnDm+jd0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aKBwlJZsaiOGwekcu3v3IwGwF2OzZTcBgjWAXZSLu32KLo0+FLjZtlwIQZycCHL54w5lmmbGM74QZlctShRAaJWGTTyngje1t6df1ZVBy9HFMojDO4XmFZL3Nr0zzINgRF449GUUjtLzV9tSQ9nnYx2fKOFZ5Clm1ca/0Cuis/g= 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; arc=none smtp.client-ip=195.135.223.131 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 Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id ED5901FB74; Wed, 21 Feb 2024 17:17:16 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 76B7013A25; Wed, 21 Feb 2024 17:17:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 1X9qDxww1mUScQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:16 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:03 -0300 Subject: [PATCH v2 1/4] selftests: livepatch: Add initial .gitignore Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-1-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=492; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=mobHejLyMa9lwd2koRFuFHd/TN2Lj+Tpf18ZnDm+jd0=; b=/hIEGXkpjh7TVD6fXJniB+mfAwmZa4nWRiV3dKm0vlhTfkx8DXT9B3XvSYSJfxnrmh0DZ2KUd q3MPSndVo/yDoZGyK2sgmloaE43WImB0t95JQj3USZD3kQ57dp2dKwB X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: ED5901FB74 X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791529751264167176 X-GMAIL-MSGID: 1791529751264167176 Ignore the binary used to test livepatching a syscall. Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/livepatch/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/livepatch/.gitignore b/tools/testing/selftests/livepatch/.gitignore new file mode 100644 index 000000000000..f1e9c2a20e99 --- /dev/null +++ b/tools/testing/selftests/livepatch/.gitignore @@ -0,0 +1 @@ +test_klp-call_getpid From patchwork Wed Feb 21 17:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 204330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1177996dyc; Wed, 21 Feb 2024 09:18:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWGAC1IihsVBaenRvUwUsxFwxpsCTuO+KzvxJ7+u4tR2wRjBwh+NhHQYB8WCtnkjVhqSvezNL4aRg3JudiMXqJfD61SPA== X-Google-Smtp-Source: AGHT+IEXwshL6X9uuMmJw2rnV8e9lKXCmfpbsS8SoESRSvnZp42MPKXRtM7wI2AqBJK3ffmlcdHW X-Received: by 2002:a05:620a:d96:b0:787:80ca:99e7 with SMTP id q22-20020a05620a0d9600b0078780ca99e7mr182856qkl.23.1708535925046; Wed, 21 Feb 2024 09:18:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708535925; cv=pass; d=google.com; s=arc-20160816; b=mRZORK63X989R5eHj1hDmNb/Y5tVmK0PQ6UoB0IEupYiagG934aEOiivH+e66TDzAH 7Pht89SWJPFSCT0JWzklk2wNQOHtdnTRgkSQy1WyLOZqGKfLVUHXZUj7eY0TVEJDNPk1 zfl5eB3L+L3VX2UPnR80PtuqKehRYYyM3cDdnXg6+mwfnuDTz15dX6oE6mrTDfKjrO/w H7yL8ybutgd9Bg5EtS1pBz824FztuMxRHWZ92POG3GA2IGrU9Gm1SHWGgKfa2jbuIJYm 4i8U5CD/BB7gRht0lbIXaVkj7fI8douScdCCE5D791Be4UWXVqjsJjpkBu2fVms8TkzP a8cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=7zBQ+jKKrfO9O4qvfQeA67+cejMB/pzT9h3QKVIFtZI=; fh=wq/8FRvx9rcFgVCe3ZmzYS1pgimebarJ6aWkDgUl4KA=; b=gr2aAQqW70RC1K8HJD8YFHrFckCUJwbsRzIewMtO9nvjrAeyRucKAvo4CgYNDhVjoC IIRdtVPhuBcq7XHLSG2Hn6syJdjRSOYOIdzYDHVmNlVgXuP/L48NBfEKTjTHyIvqG1b5 W5J2dSWGc6FpiNRKftT8Lw0W8agR/wTxFdXctnkm+a3s854yX6bNejozZ3LjsaOx2NOL RWKUMcKvivip5KmM/RoFU4iN5efbO4uDLIs1rAbrm42+4YQSLxSxX923QYehU0WwuuMg ElC8t4g5LYpxX3mPrwtAybnZSbsbC2hCwl2axfwU65YHd19m5ccru+Mf63sczto5VrhN euuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75183-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75183-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l22-20020ac84596000000b0042e2aa110easi3434773qtn.691.2024.02.21.09.18.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:18:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75183-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75183-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75183-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D2BAB1C22C74 for ; Wed, 21 Feb 2024 17:18:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A53985941; Wed, 21 Feb 2024 17:17:25 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 ECDC985920; Wed, 21 Feb 2024 17:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535843; cv=none; b=Q8SyVRcTUknVlnkHzdgVQZ3bn130UW0A1K8EQZy4yuhRxC4Pu2HvzzXMgkpwlF7yEfnMgPgzrr8Fr33o5jx/o4GGf7tMNgQhDVek25xuSxaJ9myuOKb4feEcPCoLyQxJRwD1AsaBILDoqXQ2/3hLVFUxKlLeimEvuyxG9Wzq9OM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535843; c=relaxed/simple; bh=3poRLsl87I5LGoGOxmZJk8+3nZWuoc4lJ1AqHOCLYZI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=M8e6BeU+VK3kio6ZrhSufFhW6IFTcav8l92ulW4Hl+FUn+0P9MlmThr5bjuR9ub0Go9ZHYeWou0+rFgAS6O7agYkyKk9g7m2xJ6j8MZ5LGUnT3Rcj/MZJqgIDhb1zVL5GfV3uYABsNck7YGN8JH8W0Llvk6kTXN6YuznoFzM8TE= 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; arc=none smtp.client-ip=195.135.223.131 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 Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 26CBA1FD5F; Wed, 21 Feb 2024 17:17:20 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id A574613A25; Wed, 21 Feb 2024 17:17:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id p5sFGx8w1mUWcQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:19 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:04 -0300 Subject: [PATCH v2 2/4] selftests: livepatch: Avoid running the tests if kernel-devel is missing Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-2-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza , kernel test robot X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=2202; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=3poRLsl87I5LGoGOxmZJk8+3nZWuoc4lJ1AqHOCLYZI=; b=MPj10FsveNXGa7hnAV7q6dARSYDTiOPFpQ0FKKtUWcm02p+ZxFSnUtUCDdOKV+Lc8bIZVQQ01 lD49kFKIBw0DvbKQOi5JcJK70lMbtNnNcbCyAYxscWflPw45s/FjXY5 X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 26CBA1FD5F X-Spam-Level: X-Spam-Score: -4.00 X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791529766202031169 X-GMAIL-MSGID: 1791529766202031169 By checking if KDIR is a valid directory we can safely skip the tests if kernel-devel isn't installed (default value of KDIR), or if KDIR variable passed doesn't exists. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402191417.XULH88Ct-lkp@intel.com/ Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/livepatch/functions.sh | 13 +++++++++++++ tools/testing/selftests/livepatch/test_modules/Makefile | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh index e60cf09491a6..f0ed148d3c51 100644 --- a/tools/testing/selftests/livepatch/functions.sh +++ b/tools/testing/selftests/livepatch/functions.sh @@ -34,6 +34,18 @@ function is_root() { fi } +# Check if we can compile the modules before loading them +function has_kdir() { + if [ -z "$KDIR" ]; then + KDIR="/lib/modules/$(uname -r)/build" + fi + + if [ ! -d "$KDIR" ]; then + echo "skip all tests: KDIR ($KDIR) not available to compile modules." + exit $ksft_skip + fi +} + # die(msg) - game over, man # msg - dying words function die() { @@ -108,6 +120,7 @@ function cleanup() { # the ftrace_enabled sysctl. function setup_config() { is_root + has_kdir push_config set_dynamic_debug set_ftrace_enabled 1 diff --git a/tools/testing/selftests/livepatch/test_modules/Makefile b/tools/testing/selftests/livepatch/test_modules/Makefile index f5e880269bff..e6e638c4bcba 100644 --- a/tools/testing/selftests/livepatch/test_modules/Makefile +++ b/tools/testing/selftests/livepatch/test_modules/Makefile @@ -13,8 +13,14 @@ obj-m += test_klp_atomic_replace.o \ test_klp_shadow_vars.o \ test_klp_syscall.o +# Ensure that KDIR exists, otherwise skip the compilation modules: +ifneq ("$(wildcard $(KDIR))", "") $(Q)$(MAKE) -C $(KDIR) modules KBUILD_EXTMOD=$(TESTMODS_DIR) +endif +# Ensure that KDIR exists, otherwise skip the clean target clean: +ifneq ("$(wildcard $(KDIR))", "") $(Q)$(MAKE) -C $(KDIR) clean KBUILD_EXTMOD=$(TESTMODS_DIR) +endif From patchwork Wed Feb 21 17:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 204331 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1178137dyc; Wed, 21 Feb 2024 09:18:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXg4TnMWK656+d/4DcWgxHGlRoOheZTM6WEGySnsSLASe2OP0y385J+2rI/Fn9WARuCQ/RFMuVhZeX1+4mauzZs4HcFyQ== X-Google-Smtp-Source: AGHT+IFCNKLf7Cal+V3CWTjzxnY9md4nVnS+RdZ65V8wSJdZq+0ahBTYk5nD6qOrrfdKlzvDLsmY X-Received: by 2002:a17:902:b68c:b0:1db:562c:181d with SMTP id c12-20020a170902b68c00b001db562c181dmr16620160pls.56.1708535937717; Wed, 21 Feb 2024 09:18:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708535937; cv=pass; d=google.com; s=arc-20160816; b=QTYQZGmgK5KMmj9YA7QbmiDdNUFPjn19hQUIvrJEau/jypI+4hRwCdSR4Y9DhLqkJC 9fH0QwINxNQhnJBgWLOnIT/9++2bSnjd1OHddAMo5OlNGP4AE2KQzrONd6NIcckE2ilq eF67cCWXGXvAWe1b9/3SPnqCE642g6VvG06kaURx+LiDfF2RdcJz9g5oEa7VKRcW07yX duIH+3E2vx8WcEgwu5/UvQsHbA9NfTnW1j4Blxf9XwKPjyQyf4vLM6+QxYSFdSmIfNa9 lV9ohtmgcwiw0fK3oZlhbRoIK4wEukb2ME74mhkYF2wEbxcX6oLFQfAhLFae47ofRRoJ B0mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=HbqZhhOJX07boxoLLJUyilhs4tb4nw42hQC6B37FTkA=; fh=oGTeheTGtJi/O2KL90xHksAdkswU33tM/8rayu80xMU=; b=qQZ//hNAWHVyL6I27O4yl2x4uBGt8u/Zu69Exxn+XhJWlqaXt97RTMezT2lRy+uBnP M1FZsyPW9xPUY+/SE18cIPJ9eFyAzXaVvo8VkdO+67YnrCtBOYXgpVkhsApWjZN0wbCW Dkz1CmEm3lePlBZmGKjyTppu5d4zTysUPhT2s7VLl5HlpOS/0q+l6La++nz1jIM2kNGN Xc8cNJ3MZFT/Bk/PMo9EW/ZX7ue9fXTFtMmC9JtcOsPvxaWNh9NUwb+y6GU3fraibbWp Q/bfQOriYjjRhSpmedpftnQQogYRIN7H6NX3efdHayEL9Dgjzzim/NHhy7b2ZmGhfSRa q1fA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75184-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75184-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f2-20020a170902ce8200b001dbf7f6a733si5708935plg.377.2024.02.21.09.18.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:18:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75184-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75184-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75184-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 87FD8286561 for ; Wed, 21 Feb 2024 17:18:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18FE185958; Wed, 21 Feb 2024 17:17:29 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 02F6385923; Wed, 21 Feb 2024 17:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535847; cv=none; b=N1PYkOgh+hJPAaA7a/3YTF1AYnyPXxeGFw1VbCECGe6TxsEZSG+aYvh/wPQRd1O7tjyhaTSJe5VrfKVI+8dpMnLGHt09tb/dZnYSYh0nTfcAcWVZF3QC0URR0W6fbwyuRDlR+xo8OQAtZuJpCFrcK/2st83SmAl1Ya7E8SsqWx0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535847; c=relaxed/simple; bh=/oVRt9J85nXIjb42Ew5A1lAd/g3N6kuHuj8z2sOBZ30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XY8NlBpbMOnyLZa9QTWo4zUVt9Njx1fmJYJCiBbLVb+wAMtcc2pYQkHnm4fviVeFnhcJp9J2F30ZiqHlyrYZl7RzIWebEshUULb8sHns5WGykclEPJxzhyRkNftaHJCS9NwwjfRO+bSgADuYzjDF0SuvsHIHLNfd/Ah/kXkLZCQ= 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; arc=none smtp.client-ip=195.135.223.131 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 Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 517531FB73; Wed, 21 Feb 2024 17:17:23 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id D2CEE13A25; Wed, 21 Feb 2024 17:17:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id CvCdJSIw1mUbcQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:22 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:05 -0300 Subject: [PATCH v2 3/4] selftests: lib.mk: Do not process TEST_GEN_MODS_DIR Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-3-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=1247; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=/oVRt9J85nXIjb42Ew5A1lAd/g3N6kuHuj8z2sOBZ30=; b=kwJuKPHcJm3are3nXOWsN5KVb0sSlHQg9wSH6Hq7Fy65NGToMKeDvQGCzGl04KfZTT6b17dzJ G4Baf1x9fGsChkCAp3eu9qILMcCO9LxTjGg0JKNZ2Ofhk5gIs2UptyI X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 517531FB73 X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791529779769625771 X-GMAIL-MSGID: 1791529779769625771 The directory itself doesn't need have path handling, since it's only to mean where is the directory that contains modules to be built. Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/lib.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 0d8b7db92715..286ce0ee102b 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -54,12 +54,9 @@ endif # TEST_PROGS are for test shell scripts. # TEST_CUSTOM_PROGS and TEST_PROGS will be run by common run_tests # and install targets. Common clean doesn't touch them. -# TEST_GEN_MODS_DIR is used to specify a directory with modules to be built -# before the test executes. These modules are cleaned on the clean target as well. TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) -TEST_GEN_MODS_DIR := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_MODS_DIR)) all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) \ $(if $(TEST_GEN_MODS_DIR),gen_mods_dir) From patchwork Wed Feb 21 17:17:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 204332 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1178277dyc; Wed, 21 Feb 2024 09:19:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUxarEDw61Qa2U5sk3Zz5tRHdbkZXTGe1U9+1s7UVcjaPxg3RPGdklUrlHJOwxsYBRdLkohQndVt0xTZEDGz7cDAQn/ww== X-Google-Smtp-Source: AGHT+IEsMEgKoFz/NGwkzgOGDzdKAyXhQyIVXYKsFIXBlKQC21wHxgU68eobZxbSGbYqcZMLY4dB X-Received: by 2002:ac8:5a84:0:b0:42a:a6bf:a88e with SMTP id c4-20020ac85a84000000b0042aa6bfa88emr23646242qtc.49.1708535951231; Wed, 21 Feb 2024 09:19:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708535951; cv=pass; d=google.com; s=arc-20160816; b=l5W1fSZQdz9ozxtUh+w1ANAuBjkzmNN4Tw1y3R0xO/I3FD+QVKAV4HxRj9uzRZv+9d niUljG2KQqDcY3nTOsdcraR4bRIib7rnV5b2NKepwQsON7vrK8ip7ABGmx+WZLjazyOu zed4Y6AA/3aHNYhjaXQBvWCRbECqWflUoxAvSTEEN/11Rm3lw2Q/ie9sQHw4zYlQmCLa w5r7LxV6KJF1LxWCBNDMxBuwO5NoYF/HD8se8titBWPtO2PUMkGPKQuAXgAVVvLLVb3s ADksc8eookjyIKL58l3IXyS5AjkbQpvLKekyTlhk3UQ4AEEaCIGOoiH7mhBMKVDTpOqO QgcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=D9P8j5qWhDJz4Oep9mbgqw672iDvJafFPD4oyhUBddI=; fh=oGTeheTGtJi/O2KL90xHksAdkswU33tM/8rayu80xMU=; b=ZWtN3duTCCjPyKbPKcaeyWA2VY9n7RdLGhzUiVWyJpmVAfQG+mUWt/cUcXiAswl0sE o/VfWHqBE5BmAdd8PlsSPUj5ZVknSooE5ml3ilUidhblgCQQani5tc1p8DmYODM+R+X9 NTmH0wQ9wL8RCQT6meEP5f59WQZr7klnJ4Haj1f1IU1CcqSnzVaX45dLfLOphoVcG0/p tBq8BcMdlgHUuh3B5ms1KE93mVBq6QqsvHDuaoyhoR6m2AulJv0bbeh6wRbYMKye2JcQ fb6ojngBs0ytL/rPyyLUs47lEEuwTUp+PjJaJD60HO53MG7mKN8GJTjauO/BeGjFi5sA istw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75185-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75185-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v14-20020ac8578e000000b0042db67c4ee3si1022422qta.504.2024.02.21.09.19.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:19:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75185-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-75185-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75185-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0BA111C22EE0 for ; Wed, 21 Feb 2024 17:19:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83CDA85C61; Wed, 21 Feb 2024 17:17:31 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 361E282D7B; Wed, 21 Feb 2024 17:17:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535849; cv=none; b=KPcE+bU3b4ulW791Swx4+iBUAlPBf+SCOclVYwW26xUtD1hHnzXEqsUHgBp5JcdtGtfXmU2iFjEDoonG9oGOcBS9JPciD8UObPYVGg+wYfFikVcydrwM9SoIxUpIxBhWs/CHWFMG+6G5rMBJ+c8gzcV6bJ3pEV66ApUUosV/HIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535849; c=relaxed/simple; bh=4sRYEFsMr0x8AvEq/m65uPROo9JRLFixj6hIrz82inQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D4ldHZ9PRQQACiZBOcxVZGOSa4Pu8dLQR2A86bjQNrCr07t2opDsXfo5sCDwASRAketz/vX6TXEx8zXX1e4h6+Bz+T2ShSR6W2A1coyz/aMdy2oMA70Cl3P9WGLD20sCHF36EBLw36FxWDebRoltzB/VRCQTZzpCHd8rYTmxe2s= 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; arc=none smtp.client-ip=195.135.223.130 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 Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7D1DD22102; Wed, 21 Feb 2024 17:17:26 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 0480813A25; Wed, 21 Feb 2024 17:17:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id NDH0LiUw1mUfcQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:25 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:06 -0300 Subject: [PATCH v2 4/4] selftests: lib.mk: Simplify TEST_GEN_MODS_DIR handling Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-4-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=1959; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=4sRYEFsMr0x8AvEq/m65uPROo9JRLFixj6hIrz82inQ=; b=k6aiuIGTtALvQQFLvW+j9toVR32WNNHnB+49PPw7VA8Piw3BViCkI+7gk2tvRfCvK8nNHpNmf +GfzkX3mrywBQDOhYhJOj0Oc6/3/ZgsNF/dVbog8Tek694UPM3odrvF X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 7D1DD22102 X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791529793209444962 X-GMAIL-MSGID: 1791529793209444962 We don't need new targets only to run two make modules and make clean. We can test if TEST_GEN_MODS_DIR is specified, and then run the commands. Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/lib.mk | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 286ce0ee102b..eddcd4a849dc 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -58,8 +58,9 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) -all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) \ - $(if $(TEST_GEN_MODS_DIR),gen_mods_dir) +all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) + $(if $(TEST_GEN_MODS_DIR), \ + $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR)) define RUN_TESTS BASE_DIR="$(selfdir)"; \ @@ -85,11 +86,6 @@ else @$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS)) endif -gen_mods_dir: - $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR) - -clean_mods_dir: - $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR) clean define INSTALL_SINGLE_RULE $(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH)) @@ -133,9 +129,11 @@ endif define CLEAN $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) + $(if $(TEST_GEN_MODS_DIR), \ + $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR) clean) endef -clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) +clean: $(CLEAN) # Enables to extend CFLAGS and LDFLAGS from command line, e.g. @@ -166,4 +164,4 @@ $(OUTPUT)/%:%.S $(LINK.S) $^ $(LDLIBS) -o $@ endif -.PHONY: run_tests all clean install emit_tests gen_mods_dir clean_mods_dir +.PHONY: run_tests all clean install emit_tests