All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Make rt-tests buildable for all architectures
@ 2020-11-11 22:15 Peter Bergin
  2020-11-11 22:15 ` [PATCH 1/2] rt-tests: backport patch that enable build for all archs Peter Bergin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Bergin @ 2020-11-11 22:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: Peter Bergin

As rt-tests has added frc() to oslat and frc() function is not present
on all architectures the rt-tests recipe was recently updated in commit
44010756b0ae91e0ac7715b7840285d59f991141 to avoid those.
rt-tests repo has a commit that makes another workaround for the issue.
With that commit the build always work but oslat fails in run-time if frc() is missing.
This commit series will backport that patch from rt-tets and revert oe-core
commit to allow builds for all architectures again.

Peter Bergin (2):
  rt-tests: backport patch that enable build for all archs
  Revert "rt-tests: Enable only for x86/ppc64 architectures"

 meta/recipes-rt/images/core-image-rt-sdk.bb   |  8 +--
 ...-Allow-build-for-not-supported-archs.patch | 52 +++++++++++++++++++
 meta/recipes-rt/rt-tests/rt-tests_1.9.bb      |  2 +-
 3 files changed, 54 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-rt/rt-tests/files/0001-rt-tests-oslat-Allow-build-for-not-supported-archs.patch

-- 
2.25.1


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

* [PATCH 1/2] rt-tests: backport patch that enable build for all archs
  2020-11-11 22:15 [PATCH 0/2] Make rt-tests buildable for all architectures Peter Bergin
@ 2020-11-11 22:15 ` Peter Bergin
  2020-11-11 22:15 ` [PATCH 2/2] Revert "rt-tests: Enable only for x86/ppc64 architectures" Peter Bergin
  2020-11-12  1:33 ` [OE-core] [PATCH 0/2] Make rt-tests buildable for all architectures Khem Raj
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Bergin @ 2020-11-11 22:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: Peter Bergin

Upstream rt-tests has applied a patch that allow builds for all archs.
The problem is that oslat using frc() that is not present for all archs.
With this backported patch oslat is building but in run-time an error
message is dumped if frc() is not present.

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
---
 ...-Allow-build-for-not-supported-archs.patch | 52 +++++++++++++++++++
 meta/recipes-rt/rt-tests/rt-tests_1.9.bb      |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-rt/rt-tests/files/0001-rt-tests-oslat-Allow-build-for-not-supported-archs.patch

diff --git a/meta/recipes-rt/rt-tests/files/0001-rt-tests-oslat-Allow-build-for-not-supported-archs.patch b/meta/recipes-rt/rt-tests/files/0001-rt-tests-oslat-Allow-build-for-not-supported-archs.patch
new file mode 100644
index 0000000000..1ee7539f7d
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/0001-rt-tests-oslat-Allow-build-for-not-supported-archs.patch
@@ -0,0 +1,52 @@
+From 165b597e3003c6870f5980e8902014d9344e6cf3 Mon Sep 17 00:00:00 2001
+From: Peter Xu <peterx@redhat.com>
+Date: Thu, 1 Oct 2020 14:47:26 -0400
+Subject: [PATCH] rt-tests: oslat: Allow build for not supported archs
+
+Now rt-tests won't build for archs other than x86/i386/ppc64 after oslat is
+merged.  Instead of failing the build, let's make it pass.  However, whenever
+oslat is executed, instead of running the real program, dump an error message,
+so that people can try to implement the frc() function for it when there's a
+real need for the new arch.
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/commit/?id=165b597e3003c6870f5980e8902014d9344e6cf3]
+
+Signed-off-by: Peter Xu <peterx@redhat.com>
+Signed-off-by: John Kacur <jkacur@redhat.com>
+Signed-off-by: Peter Bergin <peter@berginkonsult.se>
+
+---
+ src/oslat/oslat.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
+index f1a82f2..a8b6155 100644
+--- a/src/oslat/oslat.c
++++ b/src/oslat/oslat.c
+@@ -69,7 +69,9 @@ static inline void frc(uint64_t *pval)
+ 	__asm__ __volatile__("mfspr %0, 268\n" : "=r" (*pval));
+ }
+ # else
+-#  error Need frc() for this platform.
++#  define relax()          do { } while (0)
++#  define frc(x)
++#  define FRC_MISSING
+ # endif
+ #else
+ # error Need to add support for this compiler.
+@@ -810,6 +812,12 @@ int main(int argc, char *argv[])
+ 	int i, n_cores;
+ 	cpu_set_t cpu_set;
+ 
++#ifdef FRC_MISSING
++	printf("This architecture is not yet supported. "
++	       "Please implement frc() function first for %s.\n", argv[0]);
++	return 0;
++#endif
++
+ 	CPU_ZERO(&cpu_set);
+ 
+ 	g.app_name = argv[0];
+-- 
+2.25.1
+
diff --git a/meta/recipes-rt/rt-tests/rt-tests_1.9.bb b/meta/recipes-rt/rt-tests/rt-tests_1.9.bb
index 1fe0bd5cfc..330b5090c6 100644
--- a/meta/recipes-rt/rt-tests/rt-tests_1.9.bb
+++ b/meta/recipes-rt/rt-tests/rt-tests_1.9.bb
@@ -12,6 +12,7 @@ SRC_URI += " \
             file://run-ptest \
             file://rt_bmark.py \
             file://0001-Makefile-Allow-for-CC-and-AR-to-be-overridden.patch \
+            file://0001-rt-tests-oslat-Allow-build-for-not-supported-archs.patch \
            "
 
 # rt-tests needs PI mutex support in libc
-- 
2.25.1


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

* [PATCH 2/2] Revert "rt-tests: Enable only for x86/ppc64 architectures"
  2020-11-11 22:15 [PATCH 0/2] Make rt-tests buildable for all architectures Peter Bergin
  2020-11-11 22:15 ` [PATCH 1/2] rt-tests: backport patch that enable build for all archs Peter Bergin
@ 2020-11-11 22:15 ` Peter Bergin
  2020-11-12  1:33 ` [OE-core] [PATCH 0/2] Make rt-tests buildable for all architectures Khem Raj
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Bergin @ 2020-11-11 22:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: Peter Bergin

This reverts commit 44010756b0ae91e0ac7715b7840285d59f991141.

With the packported patch from rt-tests (67da9d8af7d8a0e1a0822e6ee99d68fa3d5a46d2)
that allows build for all archs this patch can be reverted. An error is dumped in
run-time is frc() is not present.

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
---
 meta/recipes-rt/images/core-image-rt-sdk.bb | 8 +-------
 meta/recipes-rt/rt-tests/rt-tests_1.9.bb    | 1 -
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/meta/recipes-rt/images/core-image-rt-sdk.bb b/meta/recipes-rt/images/core-image-rt-sdk.bb
index 4f2fdf12c5..624b7d9430 100644
--- a/meta/recipes-rt/images/core-image-rt-sdk.bb
+++ b/meta/recipes-rt/images/core-image-rt-sdk.bb
@@ -15,12 +15,6 @@ DEPENDS += "linux-yocto-rt"
 
 IMAGE_FEATURES += "dev-pkgs tools-sdk tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
 
-IMAGE_INSTALL += "${RTTESTS} hwlatdetect kernel-dev"
-
-RTTESTS ?= ""
-RTTESTS_powerpc64 = "rt-tests"
-RTTESTS_powerpc64le = "rt-tests"
-RTTESTS_x86 = "rt-tests"
-RTTESTS_x86-64 = "rt-tests"
+IMAGE_INSTALL += "rt-tests hwlatdetect kernel-dev"
 
 LICENSE = "MIT"
diff --git a/meta/recipes-rt/rt-tests/rt-tests_1.9.bb b/meta/recipes-rt/rt-tests/rt-tests_1.9.bb
index 330b5090c6..b916a7fe60 100644
--- a/meta/recipes-rt/rt-tests/rt-tests_1.9.bb
+++ b/meta/recipes-rt/rt-tests/rt-tests_1.9.bb
@@ -17,7 +17,6 @@ SRC_URI += " \
 
 # rt-tests needs PI mutex support in libc
 COMPATIBLE_HOST_libc-musl = 'null'
-COMPATIBLE_HOST = "(i.86.*|x86_64.*|powerpc64.*)-linux"
 
 # Do not install hwlatdetect
 EXTRA_OEMAKE += "PYLIB=''"
-- 
2.25.1


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

* Re: [OE-core] [PATCH 0/2] Make rt-tests buildable for all architectures
  2020-11-11 22:15 [PATCH 0/2] Make rt-tests buildable for all architectures Peter Bergin
  2020-11-11 22:15 ` [PATCH 1/2] rt-tests: backport patch that enable build for all archs Peter Bergin
  2020-11-11 22:15 ` [PATCH 2/2] Revert "rt-tests: Enable only for x86/ppc64 architectures" Peter Bergin
@ 2020-11-12  1:33 ` Khem Raj
  2020-11-12  7:35   ` Peter Bergin
  2 siblings, 1 reply; 6+ messages in thread
From: Khem Raj @ 2020-11-12  1:33 UTC (permalink / raw)
  To: peter; +Cc: Patches and discussions about the oe-core layer

On Wed, Nov 11, 2020 at 2:15 PM Peter Bergin <peter@berginkonsult.se> wrote:
>
> As rt-tests has added frc() to oslat and frc() function is not present
> on all architectures the rt-tests recipe was recently updated in commit
> 44010756b0ae91e0ac7715b7840285d59f991141 to avoid those.
> rt-tests repo has a commit that makes another workaround for the issue.
> With that commit the build always work but oslat fails in run-time if frc() is missing.
> This commit series will backport that patch from rt-tets and revert oe-core
> commit to allow builds for all architectures again.
>

this seems to improve the situation but its not clear if arches
without frc() will now fail miserably at runtime or will it only fail
a subset of tests and rt-tests will still be largely useful for such
arches. In the latter case, I am fine with this series.

> Peter Bergin (2):
>   rt-tests: backport patch that enable build for all archs
>   Revert "rt-tests: Enable only for x86/ppc64 architectures"
>
>  meta/recipes-rt/images/core-image-rt-sdk.bb   |  8 +--
>  ...-Allow-build-for-not-supported-archs.patch | 52 +++++++++++++++++++
>  meta/recipes-rt/rt-tests/rt-tests_1.9.bb      |  2 +-
>  3 files changed, 54 insertions(+), 8 deletions(-)
>  create mode 100644 meta/recipes-rt/rt-tests/files/0001-rt-tests-oslat-Allow-build-for-not-supported-archs.patch
>
> --
> 2.25.1
>
>
> 
>

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

* Re: [OE-core] [PATCH 0/2] Make rt-tests buildable for all architectures
  2020-11-12  1:33 ` [OE-core] [PATCH 0/2] Make rt-tests buildable for all architectures Khem Raj
@ 2020-11-12  7:35   ` Peter Bergin
  2020-11-12 16:59     ` Khem Raj
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Bergin @ 2020-11-12  7:35 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

Hi Khem,

On 2020-11-12 02:33, Khem Raj wrote:
> this seems to improve the situation but its not clear if arches
> without frc() will now fail miserably at runtime or will it only fail
> a subset of tests and rt-tests will still be largely useful for such
> arches. In the latter case, I am fine with this series.

oslat is a newly added (in v1.9) test to rt-tests and is just one of 
many tests in the suite. With this patch the oslat application will fail 
with an error message to stdout.

     #ifdef FRC_MISSING
         printf("This architecture is not yet supported. "
                "Please implement frc() function first for %s.\n", argv[0]);
         return 0;
     #endif

I searched rt-tests repo for other usages of frc() but it is isolated 
and only used in src/oslat/oslat.c. With this patch others tests in the 
rt-tests suite can be built and run on other architectures and it would 
be helpful to get it in to oe-core to be able to run, for example, 
cyclictest on arm64.

Best regards,
/Peter


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

* Re: [OE-core] [PATCH 0/2] Make rt-tests buildable for all architectures
  2020-11-12  7:35   ` Peter Bergin
@ 2020-11-12 16:59     ` Khem Raj
  0 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2020-11-12 16:59 UTC (permalink / raw)
  To: Peter Bergin; +Cc: Patches and discussions about the oe-core layer

On Wed, Nov 11, 2020 at 11:35 PM Peter Bergin <peter@berginkonsult.se> wrote:
>
> Hi Khem,
>
> On 2020-11-12 02:33, Khem Raj wrote:
> > this seems to improve the situation but its not clear if arches
> > without frc() will now fail miserably at runtime or will it only fail
> > a subset of tests and rt-tests will still be largely useful for such
> > arches. In the latter case, I am fine with this series.
>
> oslat is a newly added (in v1.9) test to rt-tests and is just one of
> many tests in the suite. With this patch the oslat application will fail
> with an error message to stdout.
>
>      #ifdef FRC_MISSING
>          printf("This architecture is not yet supported. "
>                 "Please implement frc() function first for %s.\n", argv[0]);
>          return 0;
>      #endif
>
> I searched rt-tests repo for other usages of frc() but it is isolated
> and only used in src/oslat/oslat.c. With this patch others tests in the
> rt-tests suite can be built and run on other architectures and it would
> be helpful to get it in to oe-core to be able to run, for example,
> cyclictest on arm64.
>

thanks Peter, seems fine to me then

> Best regards,
> /Peter
>

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

end of thread, other threads:[~2020-11-12 16:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11 22:15 [PATCH 0/2] Make rt-tests buildable for all architectures Peter Bergin
2020-11-11 22:15 ` [PATCH 1/2] rt-tests: backport patch that enable build for all archs Peter Bergin
2020-11-11 22:15 ` [PATCH 2/2] Revert "rt-tests: Enable only for x86/ppc64 architectures" Peter Bergin
2020-11-12  1:33 ` [OE-core] [PATCH 0/2] Make rt-tests buildable for all architectures Khem Raj
2020-11-12  7:35   ` Peter Bergin
2020-11-12 16:59     ` Khem Raj

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.