Re: [PATCH] selftests: vDSO: don't include generated headers for chacha test

From: Jason A. Donenfeld
Date: Wed Sep 11 2024 - 09:42:55 EST


On Wed, Sep 11, 2024 at 03:01:26PM +0200, Jason A. Donenfeld wrote:
> On Wed, Sep 11, 2024 at 02:47:02PM +0200, Jason A. Donenfeld wrote:
> > On Wed, Sep 11, 2024 at 11:14:06AM +0100, Mark Brown wrote:
> > > On Wed, Sep 11, 2024 at 04:44:48AM +0200, Jason A. Donenfeld wrote:
> > > > On Tue, Sep 10, 2024 at 11:52:51PM +0100, Aishwarya TCV wrote:
> > > > > make[4]: *** [Makefile:299:
> > > > > /tmp/kci/linux/build/kselftest/kvm/aarch64/aarch32_id_regs.o] Error 1
> > > > > make[4]: Leaving directory '/tmp/kci/linux/tools/testing/selftests/kvm'
> > >
> > > > You sure this bisected right? That directory isn't related to the
> > > > commit in question, I don't think...
> > >
> > > I eyeballed it for Aishwarya and it looked related on first glance
> > > (messing around with the generated headers), though looking again it's
> > > only in the vDSO directory so shouldn't be messing up other
> > > directories...
> >
> > Okay, so... I reproduced the problem on linux-next. Then I reverted the
> > commit and reproduced it again. Then just to be sure, I ran:
> >
> > $ git checkout v6.9 tools/testing/selftests/vDSO/
> >
> > And then I reproduced the problem again.
> >
> > So I think we can be somewhat certain the unrelated directory is indeed
> > unrelated.
>
> Ahhh, got it.
>
> Running `$ rm tools/include/asm/sysreg-defs.h` fixes the problem. I'll
> look into a fix this afternoon.

I'll fix it up as follows:

diff --git a/tools/include/asm/asm-offsets.h b/tools/include/generated/asm-offsets.h
similarity index 100%
rename from tools/include/asm/asm-offsets.h
rename to tools/include/generated/asm-offsets.h
diff --git a/tools/include/asm/cpucap-defs.h b/tools/include/generated/asm/cpucap-defs.h
similarity index 100%
rename from tools/include/asm/cpucap-defs.h
rename to tools/include/generated/asm/cpucap-defs.h
diff --git a/tools/include/asm/sysreg-defs.h b/tools/include/generated/asm/sysreg-defs.h
similarity index 100%
rename from tools/include/asm/sysreg-defs.h
rename to tools/include/generated/asm/sysreg-defs.h
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 5bd30d745d42..86ebc4115eda 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -39,6 +39,7 @@ $(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \

$(OUTPUT)/vdso_test_chacha: $(top_srcdir)/tools/arch/$(SRCARCH)/vdso/vgetrandom-chacha.S
$(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \
+ -idirafter $(top_srcdir)/tools/include/generated \
-idirafter $(top_srcdir)/arch/$(SRCARCH)/include \
-idirafter $(top_srcdir)/include \
-D__ASSEMBLY__ -Wa,--noexecstack