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 825D6C47258 for ; Wed, 31 Jan 2024 18:39:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D37026B0093; Wed, 31 Jan 2024 13:39:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CC1076B0096; Wed, 31 Jan 2024 13:39:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B612A6B009A; Wed, 31 Jan 2024 13:39:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A04DF6B0093 for ; Wed, 31 Jan 2024 13:39:43 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 68A161A0D95 for ; Wed, 31 Jan 2024 18:39:43 +0000 (UTC) X-FDA: 81740469846.05.B0F0307 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf29.hostedemail.com (Postfix) with ESMTP id 2EB1412002E for ; Wed, 31 Jan 2024 18:39:40 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=RoLccr6L; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf29.hostedemail.com: domain of mpdesouza@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mpdesouza@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706726381; 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=juQop2NLnMwYPIZdL2w80qPR0dgX4OMioW8zN30dagw=; b=odau8AH5qheXZkwERgZ3JxS+mBl7V+xe/ZnOwulp3oxmO1SeKmtt04NghKqPK7p1Nfl+Bc 0sjn72L2VO57P4Sl+SL7172TwMnYJhBq4ca1ad1oOndAZ98o83sC4LSrwMqZlltwuW/GZ2 vpxzJ2TGOLHelkDrhFQmCYW+hkV0m9I= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=RoLccr6L; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf29.hostedemail.com: domain of mpdesouza@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mpdesouza@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706726381; a=rsa-sha256; cv=none; b=HIgFLd7clt6xKgNxuVf6sbWzdkGXLaOwYcSx2BUdzo1SmtDFZE00g70CMpEDcGMWXQbjAw A2MHNAQqKB8HchxV4hN9ikdfC6Bku1cXrvaqWzOj6JbhS2v7YZSrdqAXOa96jUsbnVq75k 0nHuVPBDFh78a5QnlrimdV470P/72ts= Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40f02b8d176so1100115e9.1 for ; Wed, 31 Jan 2024 10:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1706726379; x=1707331179; darn=kvack.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=juQop2NLnMwYPIZdL2w80qPR0dgX4OMioW8zN30dagw=; b=RoLccr6LQfTTRVZq82pEV4xPVdLjLkA6OP1pEAS4tlhLQvzssF8sLXvLhi5fVukgPC ejRoX9095L2mZJHupWI9Rni4JvALiSpmhvFK9zs8Uj8fUbA6ap7E/7rc/6SzwGgASR45 q5p0mrT2wYgZlV8mGNbIariPAQ6lvlYlMwboazd5IfdzLVrns1AkJz3PGO7HUOmqi5sa bTXx1JvCfZ1GtsDwCbxjuA/jsWnowWplNAHrixe7PoNetbIIFNlYZR31e7sfWRoDSjnL tjWgNCwEIVpZisygcspbuHtx6X0ipdTIq6Iv+rrIxi44L3pwZRwYTjSlr4RJV+Nw7yGD KNxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706726379; x=1707331179; 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=juQop2NLnMwYPIZdL2w80qPR0dgX4OMioW8zN30dagw=; b=IAL0Z36q8lQ49cb5qY1opswYTHp8PdwFxV7neBgi5TiRMJeCHnENtbrlaKwZn6Dwh2 p36HpuWZVw3Xth5c6YjpRU9UbrLFTZg7ty5x/IAbIGLlmvTsVvaN2NiRlJgqOD4+I+Qz lEqSQR5g6OwPY3o2Z6hiEIdnTqf9hI+RRLajGX7MEnVsm9AAdTtKNeUQllXOPDWPNZPs UVBEsa5Gj9kiQR3m/BN1e0Mp2m1qLvYwKqq8ZH58goa8QJ3HfsZpIbWFncjsrfpvgKN6 hGt632V8WiF9xz8KLs6iWqfROPCW0xSsdscFM4ZW2sQsamsFq9L+YWj/tjxq6iwcPYhB 8Qdw== X-Gm-Message-State: AOJu0Yx4dMxE4l4T0ZFSzSRLUHBfcxBqFfvd3e9/BuPlp+Sk36sVG2+Z VTc/uzy+ZpAsnlryuZiAmnxmTO1gFX7uWjeT6m4QaP+eVUJ741ky9K8szgM5Sy4= X-Google-Smtp-Source: AGHT+IHFJozvWPnKH7zmV7YyFXo20oEXLwg+l1dqJtygT+5eOiyTMhOkvHRtb30hGnIZlH7poY3HTg== X-Received: by 2002:a05:600c:19cf:b0:40f:b732:1ed7 with SMTP id u15-20020a05600c19cf00b0040fb7321ed7mr812966wmq.34.1706726379446; Wed, 31 Jan 2024 10:39:39 -0800 (PST) Received: from ?IPv6:2804:30c:1f49:9200:d29b:2478:179f:fbac? ([2804:30c:1f49:9200:d29b:2478:179f:fbac]) by smtp.gmail.com with ESMTPSA id b26-20020adf9b1a000000b0033924b4d1f9sm14124717wrc.94.2024.01.31.10.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 10:39:39 -0800 (PST) Message-ID: Subject: Re: [linux-next:master 1016/2825] make[2]: *** kselftest/livepatch/test_modules: No such file or directory. Stop. From: Marcos Paulo de Souza To: Petr Mladek Cc: kernel test robot , oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Shuah Khan , Joe Lawrence Date: Wed, 31 Jan 2024 15:39:35 -0300 In-Reply-To: References: <202401300736.GkSZoSrA-lkp@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3 (by Flathub.org) MIME-Version: 1.0 X-Rspamd-Queue-Id: 2EB1412002E X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: fwkua6urxbooimey8t5ohj55zjbwsqnf X-HE-Tag: 1706726380-518961 X-HE-Meta: U2FsdGVkX18TQ4I+TQwMD0wcOJk9gP+wD2V3cVpwTIrncyITl1LPlkdojaZS9aOcLnA2fV2bEucDDC4hCjASXIuv+okI2TA/6SsamrttDTTermSJSS84L7qVRguMD8hbMWlryZyB6W7EA66y4W9JfZGjsIeusP6aMYb8Qa6LwDHn5sXKQZe6aCE2Vbcx0TTLZaL+aQeNzTVYRsFnNxWAG1mbqHiTxyhNMcw3uUdkiXqYklCwtd7c4zId+afUz2I0khbwoEVb1pEkaTazn/+IdAWeLwowol4j6JpvizYHaHh8873vqTB0UYjNEAyepQq38VUq+JD5Xj1Du3D8fdcgOi7ZqaNnyjt+aBqANaMFyaD6+9gZcoAMbKKY9avx0nCiyKSKrj7W7A+dwAVQlkTRZ1h7E0qR31ibKYryRG5N7C2Nt1Y5qOxrO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ntr/Mm4caVZ/EcesV4IT6pQUmhS9WFSDAHNfNpGDJZvfTZI9zEtgCTPkDzQqldqYlLJrjuGtIRjfbGhEtn1tX1qMTFOxa+gs8CngcVG+4tkuwhr146jOK9tfxLinf+QKSKGvxqL84nqYZENQYwo3tkyPXsbPWMRPP4hmUq+qXbcjLsGOGB9kf7FQ== 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 Wed, 2024-01-31 at 16:34 +0100, Petr Mladek wrote: > On Tue 2024-01-30 11:39:56, Marcos Paulo de Souza wrote: > > On Tue, 2024-01-30 at 07:08 +0800, kernel test robot wrote: > > > tree:=C2=A0=C2=A0 > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > > > =C2=A0m > > > aster > > > head:=C2=A0=C2=A0 596764183be8ebb13352b281a442a1f1151c9b06 > > > commit: c4bbe83d27c2446a033cc0381c3fb6be5e8c41c7 [1016/2825] > > > livepatch: Move tests from lib/livepatch to selftests/livepatch > > > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 > > > reproduce (this is a W=3D1 build): > > > ( > > > https://download.01.org/0day-ci/archive/20240130/202401300736.GkSZ > > > oS > > > rA-lkp@intel.com/reproduce) > > >=20 > > When looking at the lib.mk, I just followed the other variables and > > did > > the same: > >=20 > > TEST_GEN_MODS_DIR :=3D $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_MODS_DIR)) > >=20 > > But later on, I jump into $(TEST_GEN_MODS_DIR), which is invalid > > because of the O=3D that is used a prefix for the path: > > /tmp/kselftest/kselftest/livepatch/test_modules. My first idea was > > to > > just remove the patsubst and take TEST_GEN_MODS_DIR, which should > > be > > livepatch/test_modules in this case, but it then returns another > > problem: > >=20 > >=20 > > make: Entering directory > > '/home/mpdesouza/git/linux/tools/testing/selftests' > > make[1]: Entering directory > > '/home/mpdesouza/git/linux/tools/testing/selftests/livepatch' > > make -C test_modules > > make[2]: Entering directory > > '/home/mpdesouza/git/linux/tools/testing/selftests/livepatch/test_m > > odul > >=20 > > es' > > make -C /lib/modules/6.5.9-1-default/build modules > > KBUILD_EXTMOD=3D/home/mpdesouza/git/linux/tools/testing/selftests/liv > > epat > >=20 > > ch/test_modules >=20 > Nit: There are sometimes strange empty lines between split long > =C2=A0=C2=A0=C2=A0=C2=A0 lines. It looks like somehow messed cut&paste. Sorry about it. I'll double check the output next time I copy from my terminal. >=20 > > make[3]: Entering directory '/usr/src/linux-6.5.9-1- > > obj/x86_64/default' > > make[4]: Entering directory '/tmp/kselftest' > > /usr/src/linux-6.5.9-1/Makefile:754: include/config/auto.conf: No > > such > > file or directory >=20 > I see the same. It looks to me like a bug in kernel-devel package. >=20 > /usr/src/linux-6.5.9-1/Makefile is from the kernel-devel package > for the running kernel. It should try to include auto.conf used > for building the running kernel: >=20 > =C2=A0 1. auto.conf should be packaged in kernel-devel. >=20 > =C2=A0 2. The Makefile from the kernel-devel packages should be able > =C2=A0=C2=A0=C2=A0=C2=A0 to find/use auto.conf from the kernel-devel pack= age. >=20 > IMHO, this actually helped to find a bug that > make -C tools/testing/selftests/livepatch used auto.conf from > the git tree while the modules are built against headers > for the running kernel. >=20 > That said, I wonder why this problem does not happen when building > external modules (KMPs). I would expect that they are using > the same Makefile from the kernel-devel package. >=20 > Maybe the external modules somehow manage to clear "need-config" > used by /usr/src/linux-6.5.9-1/Makefile. Maybe we do not need > to include it either. >=20 > > make[4]: *** [/usr/src/linux-6.5.9-1/Makefile:234: __sub-make] > > Error 2 > > make[4]: Leaving directory '/tmp/kselftest' > > make[3]: *** [../../../linux-6.5.9-1/Makefile:234: __sub-make] > > Error 2 > > make[3]: Leaving directory '/usr/src/linux-6.5.9-1- > > obj/x86_64/default' > > make[2]: *** [Makefile:16: modules] Error 2 > > make[2]: Leaving directory > > '/home/mpdesouza/git/linux/tools/testing/selftests/livepatch/test_m > > odul > >=20 > > es' > > make[1]: *** [../lib.mk:92: gen_mods_dir] Error 2 > > make[1]: Leaving directory > > '/home/mpdesouza/git/linux/tools/testing/selftests/livepatch' > > make: *** [Makefile:180: all] Error 2 > > make: Leaving directory > > '/home/mpdesouza/git/linux/tools/testing/selftests' Well, this maybe be indeed a bug in kernel-devel. I added some debug messages to make (-dd), and I believe that I understood what's going wrong. First of all, if we compile an out-of-tree module, like this: make -C tools/testing/selftests/livepatch/test_modules it goes to /usr/src/linux-6.5.9-1-obj/x86_64/default, and everything works. I printed the abs_objtree and it's in fact where it should. On like 234 of the toplevel Makefile, ion the __sub-make target, it executed the make passed -C to $(abs_objtree), and -f to $(abs_srctree). abs_objtree points to /usr/src/linux-6.5.9-1- obj/x86_64/default while abs_srctree points to /usr/src/linux-6.5.9-1. Everything works. But things change whenever we use the O=3D argument. Its value is passed to abs_objtree, making the __sub-make to execute is a peculiar way: while abs_objtree is /tmp/kselftest, abs_srctree continues to be /usr/src/linux-6.5.9-1. That's why the include fails in this case: ifdef need-config =20 include include/config/auto.conf =20 endif As we are calling the include from /tmp/kselftest, and Makefile include rules try to searching for the file in the directory of it's execution[1], it fails. IIUC, all include paths on the toplevel makefile should have $(abs_srctree) as prefix, so it could work. But as Petr said, we don't have the include/config directory packaged in kernel-devel. I would like to note that this is a problem with out-of-tree module building, and not only kselftest related. If we pass O=3D when building a module, this will happen. For testing purposes, I added the include/{generated,config} directories into my /usr/src/linux/include, and added abs_srctree to the include mentioned above, and now it's failing with: # CC [M]=20 /home/mpdesouza/git/linux/tools/testing/selftests/livepatch/test_module s/test_klp_atomic_replace.o gcc -Wp,- MMD,/home/mpdesouza/git/linux/tools/testing/selftests/livepatch/test_mo dules/.test_klp_atomic_replace.o.d -nostdinc -I/usr/src/linux-6.5.9- 1/arch/x86/include -I./arch/x86/include/generated -I/usr/src/linux- 6.5.9-1/include -I./include -I/usr/src/linux-6.5.9- 1/arch/x86/include/uapi -I./arch/x86/include/generated/uapi - I/usr/src/linux-6.5.9-1/include/uapi -I./include/generated/uapi - include /usr/src/linux-6.5.9-1/include/linux/compiler-version.h - include /usr/src/linux-6.5.9-1/include/linux/kconfig.h -include /usr/src/linux-6.5.9-1/include/linux/compiler_types.h -D__KERNEL__ - Werror -fmacro-prefix-map=3D/usr/src/linux-6.5.9-1/=3D -std=3Dgnu11 -fshort= - wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -Wall - Wundef -Werror=3Dimplicit-function-declaration -Werror=3Dimplicit-int - Werror=3Dreturn-type -Werror=3Dstrict-prototypes -Wno-format-security -Wno- trigraphs -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf- protection=3Dbranch -fno-jump-tables -m64 -falign-jumps=3D1 -falign-loops= =3D1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3D3 -mskip-rax- setup -mtune=3Dgeneric -mno-red-zone -mcmodel=3Dkernel -Wno-sign-compare - fno-asynchronous-unwind-tables -mindirect-branch=3Dthunk-extern - mindirect-branch-register -mindirect-branch-cs-prefix -mfunction- return=3Dthunk-extern -fno-jump-tables -fpatchable-function-entry=3D16,16 - fno-delete-null-pointer-checks -Wno-frame-address -Wno-format- truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno- allow-store-data-races -Wframe-larger-than=3D2048 -fstack-protector- strong -Wno-main -Wno-unused-but-set-variable -Wno-unused-const- variable -Wno-dangling-pointer -ftrivial-auto-var-init=3Dzero -fno-stack- clash-protection -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY - falign-functions=3D16 -Wvla -Wno-pointer-sign -Wcast-function-type - fstrict-flex-arrays=3D3 -Wno-stringop-truncation -Wno-stringop-overflow - Wno-restrict -Wno-maybe-uninitialized -Wno-array-bounds -Wno-alloc- size-larger-than -Wimplicit-fallthrough=3D5 -fno-strict-overflow -fno- stack-check -fconserve-stack -Werror=3Ddate-time -Werror=3Dincompatible- pointer-types -Werror=3Ddesignated-init -Wno-packed-not-aligned -g - DMODULE -DKBUILD_BASENAME=3D'"test_klp_atomic_replace"' - DKBUILD_MODNAME=3D'"test_klp_atomic_replace"' - D__KBUILD_MODNAME=3Dkmod_test_klp_atomic_replace -c -o /home/mpdesouza/git/linux/tools/testing/selftests/livepatch/test_module s/test_klp_atomic_replace.o /home/mpdesouza/git/linux/tools/testing/selftests/livepatch/test_module s/test_klp_atomic_replace.c =20 In file included from /usr/src/linux-6.5.9- 1/include/linux/build_bug.h:5, from /usr/src/linux-6.5.9- 1/include/linux/container_of.h:5, from /usr/src/linux-6.5.9-1/include/linux/list.h:5, from /usr/src/linux-6.5.9-1/include/linux/module.h:12, from /home/mpdesouza/git/linux/tools/testing/selftests/livepatch/test_module s/test_klp_atomic_replace.c:6: /usr/src/linux-6.5.9-1/include/linux/compiler.h:246:10: fatal error: asm/rwonce.h: No such file or directory 246 | #include | ^~~~~~~~~~~~~~ compilation terminated. Which seems to be missing the asm-generic targets (?). I'm not sure what to think now, if this is indeed a bug or if we should adjust other configurations. As you can see, my lack of Kbuild/Makefile knowledge is big, but I'm doing my best to understand what's wrong and how I could fix it :) What do you think about it? Thanks in advance! (I'm not sure if the output is messed up again...) [1]: https://www.gnu.org/software/make/manual/html_node/Include.html >=20 > Best Regards, > Petr