All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] configure: Check for KVM linker script support
@ 2022-06-10 13:14 Martin Doucha
  2022-06-10 13:33 ` Cyril Hrubis
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Doucha @ 2022-06-10 13:14 UTC (permalink / raw)
  To: ltp

Some toolchains don't fully support the KVM linker scripts. Disable KVM tests
if linker check fails in configure script.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 configure.ac              | 14 ++++++++++++++
 include/mk/features.mk.in |  3 +++
 testcases/kernel/Makefile |  5 ++++-
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 816ebf820..88ecbafda 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,6 +397,20 @@ LTP_CHECK_TASKSTATS
 test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
 LTP_DETECT_HOST_CPU
 
+AC_MSG_CHECKING([whether linker can handle KVM payloads])
+ltp_backup_ldflags=$LDFLAGS
+LDFLAGS="$LDFLAGS -T ${srcdir}/testcases/kernel/kvm/linker/${HOST_CPU}.lds"
+AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+  [
+    AC_MSG_RESULT([yes])
+    AC_SUBST([WITH_KVM_TESTSUITE],["yes"])
+  ],
+  [
+    AC_MSG_RESULT([no])
+    AC_SUBST([WITH_KVM_TESTSUITE],["no"])
+  ])
+LDFLAGS="$ltp_backup_ldflags"
+
 AC_OUTPUT
 
 cat << EOF
diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
index ecb15a0f7..802ee0ba8 100644
--- a/include/mk/features.mk.in
+++ b/include/mk/features.mk.in
@@ -52,3 +52,6 @@ WITH_REALTIME_TESTSUITE		:= no
 else
 WITH_REALTIME_TESTSUITE		:= @WITH_REALTIME_TESTSUITE@
 endif
+
+# Enable testcases/kernel/kvm compile and install?
+WITH_KVM_TESTSUITE		:= @WITH_KVM_TESTSUITE@
diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
index c0fa24147..bf890e175 100644
--- a/testcases/kernel/Makefile
+++ b/testcases/kernel/Makefile
@@ -29,7 +29,6 @@ SUBDIRS			+= connectors \
 			   io \
 			   ipc \
 			   irq \
-			   kvm \
 			   logging \
 			   mem \
 			   numa \
@@ -45,6 +44,10 @@ ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
 SUBDIRS			+= power_management
 endif
 
+ifeq ($(WITH_KVM_TESTSUITE),yes)
+SUBDIRS			+= kvm
+endif
+
 endif
 
 ifeq ($(ANDROID),1)
-- 
2.36.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] configure: Check for KVM linker script support
  2022-06-10 13:14 [LTP] [PATCH] configure: Check for KVM linker script support Martin Doucha
@ 2022-06-10 13:33 ` Cyril Hrubis
  2022-06-10 13:39   ` Cyril Hrubis
  2022-06-10 14:42   ` Martin Doucha
  0 siblings, 2 replies; 8+ messages in thread
From: Cyril Hrubis @ 2022-06-10 13:33 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi!
> Some toolchains don't fully support the KVM linker scripts. Disable KVM tests
> if linker check fails in configure script.
> 
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  configure.ac              | 14 ++++++++++++++
>  include/mk/features.mk.in |  3 +++
>  testcases/kernel/Makefile |  5 ++++-
>  3 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 816ebf820..88ecbafda 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -397,6 +397,20 @@ LTP_CHECK_TASKSTATS
>  test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
>  LTP_DETECT_HOST_CPU
>  
> +AC_MSG_CHECKING([whether linker can handle KVM payloads])
> +ltp_backup_ldflags=$LDFLAGS
> +LDFLAGS="$LDFLAGS -T ${srcdir}/testcases/kernel/kvm/linker/${HOST_CPU}.lds"
> +AC_LINK_IFELSE([AC_LANG_PROGRAM()],
> +  [
> +    AC_MSG_RESULT([yes])
> +    AC_SUBST([WITH_KVM_TESTSUITE],["yes"])
> +  ],
> +  [
> +    AC_MSG_RESULT([no])
> +    AC_SUBST([WITH_KVM_TESTSUITE],["no"])
> +  ])
> +LDFLAGS="$ltp_backup_ldflags"
> +
>  AC_OUTPUT
>  
>  cat << EOF
> diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
> index ecb15a0f7..802ee0ba8 100644
> --- a/include/mk/features.mk.in
> +++ b/include/mk/features.mk.in
> @@ -52,3 +52,6 @@ WITH_REALTIME_TESTSUITE		:= no
>  else
>  WITH_REALTIME_TESTSUITE		:= @WITH_REALTIME_TESTSUITE@
>  endif
> +
> +# Enable testcases/kernel/kvm compile and install?
> +WITH_KVM_TESTSUITE		:= @WITH_KVM_TESTSUITE@
> diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
> index c0fa24147..bf890e175 100644
> --- a/testcases/kernel/Makefile
> +++ b/testcases/kernel/Makefile
> @@ -29,7 +29,6 @@ SUBDIRS			+= connectors \
>  			   io \
>  			   ipc \
>  			   irq \
> -			   kvm \
>  			   logging \
>  			   mem \
>  			   numa \
> @@ -45,6 +44,10 @@ ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
>  SUBDIRS			+= power_management
>  endif
>  
> +ifeq ($(WITH_KVM_TESTSUITE),yes)
> +SUBDIRS			+= kvm
> +endif

Skipping the whole directory will actually cause problems too, since the
runltp files does include the kvm_pagefault01 now which will obvious
fail because the binary would be missing.

I'm not sure what the best solution would be, maybe install dummy
libraries that just print TCONF in a case that linker does now work?

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] configure: Check for KVM linker script support
  2022-06-10 13:33 ` Cyril Hrubis
@ 2022-06-10 13:39   ` Cyril Hrubis
  2022-06-10 14:42   ` Martin Doucha
  1 sibling, 0 replies; 8+ messages in thread
From: Cyril Hrubis @ 2022-06-10 13:39 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi!
> Skipping the whole directory will actually cause problems too, since the
> runltp files does include the kvm_pagefault01 now which will obvious
> fail because the binary would be missing.
> 
> I'm not sure what the best solution would be, maybe install dummy
> libraries that just print TCONF in a case that linker does now work?

s/libraries/binaries/

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] configure: Check for KVM linker script support
  2022-06-10 13:33 ` Cyril Hrubis
  2022-06-10 13:39   ` Cyril Hrubis
@ 2022-06-10 14:42   ` Martin Doucha
  2022-06-13  8:15     ` Cyril Hrubis
  1 sibling, 1 reply; 8+ messages in thread
From: Martin Doucha @ 2022-06-10 14:42 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

On 10. 06. 22 15:33, Cyril Hrubis wrote:
> Skipping the whole directory will actually cause problems too, since the
> runltp files does include the kvm_pagefault01 now which will obvious
> fail because the binary would be missing.
> 
> I'm not sure what the best solution would be, maybe install dummy
> libraries that just print TCONF in a case that linker does now work?

KVM tests have their own runfile which can be simply skipped. These
tests should not be included in any other runfiles because they should
only be run on baremetal. That's the solution: Don't run the KVM runfile
if the KVM tests were not built.

Also, the KVM Makefile already builds nothing on non-x86 archs so the
problem was there from the beginning.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] configure: Check for KVM linker script support
  2022-06-10 14:42   ` Martin Doucha
@ 2022-06-13  8:15     ` Cyril Hrubis
  2022-06-13 11:59       ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2022-06-13  8:15 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi!
> > Skipping the whole directory will actually cause problems too, since the
> > runltp files does include the kvm_pagefault01 now which will obvious
> > fail because the binary would be missing.
> > 
> > I'm not sure what the best solution would be, maybe install dummy
> > libraries that just print TCONF in a case that linker does now work?
> 
> KVM tests have their own runfile which can be simply skipped. These
> tests should not be included in any other runfiles because they should
> only be run on baremetal. That's the solution: Don't run the KVM runfile
> if the KVM tests were not built.
> 
> Also, the KVM Makefile already builds nothing on non-x86 archs so the
> problem was there from the beginning.

Looks like these are not in default scenario either, then this is not a
reson to block the patch. However we should really figure out how to
deal with cases like this at least for the new testrunner.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] configure: Check for KVM linker script support
  2022-06-13  8:15     ` Cyril Hrubis
@ 2022-06-13 11:59       ` Petr Vorel
  2022-06-13 12:54         ` Martin Doucha
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2022-06-13 11:59 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

> Hi!
> > > Skipping the whole directory will actually cause problems too, since the
> > > runltp files does include the kvm_pagefault01 now which will obvious
> > > fail because the binary would be missing.

> > > I'm not sure what the best solution would be, maybe install dummy
> > > libraries that just print TCONF in a case that linker does now work?

> > KVM tests have their own runfile which can be simply skipped. These
> > tests should not be included in any other runfiles because they should
> > only be run on baremetal. That's the solution: Don't run the KVM runfile
> > if the KVM tests were not built.

> > Also, the KVM Makefile already builds nothing on non-x86 archs so the
> > problem was there from the beginning.

I thought we're using TST_TEST_TCONF() for non-x86 archs.

> Looks like these are not in default scenario either, then this is not a
> reson to block the patch. However we should really figure out how to
> deal with cases like this at least for the new testrunner.

Yes, not having to use TST_TEST_TCONF() would be nice.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] configure: Check for KVM linker script support
  2022-06-13 11:59       ` Petr Vorel
@ 2022-06-13 12:54         ` Martin Doucha
  2022-06-13 13:49           ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Doucha @ 2022-06-13 12:54 UTC (permalink / raw)
  To: Petr Vorel, Cyril Hrubis; +Cc: ltp

On 13. 06. 22 13:59, Petr Vorel wrote:
>>> Also, the KVM Makefile already builds nothing on non-x86 archs so the
>>> problem was there from the beginning.
> 
> I thought we're using TST_TEST_TCONF() for non-x86 archs.

We will use TST_TEST_TCONF() for KVM on unsupported archs once they have
their own guest bootstrap code (which is currently available only for
32bit and 64bit x86). But it is not possible to link test binaries
without bootstrap code so non-x86 archs are currently skipped during build.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] configure: Check for KVM linker script support
  2022-06-13 12:54         ` Martin Doucha
@ 2022-06-13 13:49           ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2022-06-13 13:49 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,

> > I thought we're using TST_TEST_TCONF() for non-x86 archs.

> We will use TST_TEST_TCONF() for KVM on unsupported archs once they have
> their own guest bootstrap code (which is currently available only for
> 32bit and 64bit x86). But it is not possible to link test binaries
> without bootstrap code so non-x86 archs are currently skipped during build.

Ah, makes sense. Thanks for info!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-13 13:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 13:14 [LTP] [PATCH] configure: Check for KVM linker script support Martin Doucha
2022-06-10 13:33 ` Cyril Hrubis
2022-06-10 13:39   ` Cyril Hrubis
2022-06-10 14:42   ` Martin Doucha
2022-06-13  8:15     ` Cyril Hrubis
2022-06-13 11:59       ` Petr Vorel
2022-06-13 12:54         ` Martin Doucha
2022-06-13 13:49           ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.