Skip to contentSkip to conversation

Preview: 4.19-x86 support

DISCUSSION Jan Kiszka 3 participants 14 messages Jun 18, 2019 – Jun 28, 2019

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi all,

@all early adopters: There is a first version of upcoming x86 support based on the 4.19 kernel available at [1]. You need Xenomai master for it. The kernel should boot and run Xenomai workload fine - at least it does here so far. I only see one lockdep splat during early boot that needs to be sorted out. Possibly just an instrumentation issue, not a real problem. For the first release, cleaning up the series and adding latest 4.19 support are on my to-do list.

Early test reports appreciated!

Jan

[1] https://gitlab.denx.de/Xenomai/ipipe-x86/commits/wip/ipipe-x86-4.19.y

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#1 lore raw

Hi, a bit OT: How hard is it for you guys to re-write IPIPE on top of the latest entry_64.S file? I mean, every few kernel releases, especially when KAISER/RETROLINE was introduced, that file changed dramatically. Is x86 assembly programming easy for you Jan and Philippe? You're both extremely good at what you do.

Alec

author
#2 lore raw
Quoted 1 line · Alec Ari

Hi, a bit OT: How hard is it for you guys to re-write IPIPE on top of the latest entry_64.S file? I mean, every few kernel releases, especially when KAISER/RETROLINE was introduced, that file changed dramatically. Is x86 assembly programming easy for you Jan and Philippe? You're both extremely good at what you do.

The Spectre/Meltdown fixes were actually widely orthogonal to I-pipe. Porting to 4.19 had a few conflicts in the entry code, but nothing that was awfully hard to resolve when looking at the old I-pipe patch and the changes to that file in mainline since then.

Thanks to Philippe's rework of the patch queue, we have a functional split-up now that helps rebasing the patches. It can and will be further improved, but it is already valuable, hopefully also for other contributors: We definitely need more people on these kernel topics.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#3 lore raw
In reply to Jan Kiszka

Hi Jan,

works fine. The only thing that did not was the gdb smokey test.

Quoted 2 lines

FAILURE run_gdb:288: checking expression "primary_mode", expected "$", found "N"

did not look into where this came from.

Tested todays master but think the 4.19 changes should be backported to stable as well.

I also ran into an smb issue from upstream, which is fixed there. So i think this should be rebased on latest 4.19 eventually. Or leave it on 33 and merge for the first release.

Henning

Am Tue, 18 Jun 2019 18:37:14 +0200
schrieb Jan Kiszka via Xenomai <[email protected]>:

Quoted 17 lines

Hi all,

@all early adopters: There is a first version of upcoming x86 support based on the 4.19 kernel available at [1]. You need Xenomai master for it. The kernel should boot and run Xenomai workload fine - at least it does here so far. I only see one lockdep splat during early boot that needs to be sorted out. Possibly just an instrumentation issue, not a real problem. For the first release, cleaning up the series and adding latest 4.19 support are on my to-do list.

Early test reports appreciated!

Jan

[1]
https://gitlab.denx.de/Xenomai/ipipe-x86/commits/wip/ipipe-x86-4.19.y

author
#4 lore raw
Quoted 8 lines · Henning Schild via Xenomai

Hi Jan,

works fine. The only thing that did not was the gdb smokey test.

Quoted 2 lines

FAILURE run_gdb:288: checking expression "primary_mode", expected "$", found "N"

did not look into where this came from.

OK, didn't see that so far. Did you only see this on 4.19 so far, ie. did you test 4.14 or older with master recently?

Quoted 3 lines

Tested todays master but think the 4.19 changes should be backported to stable as well.

I'm not planning for that due to the number of changes involved. 3.1 will come out "soon", and that is for newer kernels.

Quoted 4 lines

I also ran into an smb issue from upstream, which is fixed there. So i think this should be rebased on latest 4.19 eventually. Or leave it on 33 and merge for the first release.

Which one exactly?

Thanks,
Jan

Quoted 26 lines

Henning

Am Tue, 18 Jun 2019 18:37:14 +0200
schrieb Jan Kiszka via Xenomai <[email protected]>:

Quoted 17 lines

Hi all,

@all early adopters: There is a first version of upcoming x86 support based on the 4.19 kernel available at [1]. You need Xenomai master for it. The kernel should boot and run Xenomai workload fine - at least it does here so far. I only see one lockdep splat during early boot that needs to be sorted out. Possibly just an instrumentation issue, not a real problem. For the first release, cleaning up the series and adding latest 4.19 support are on my to-do list.

Early test reports appreciated!

Jan

[1]
https://gitlab.denx.de/Xenomai/ipipe-x86/commits/wip/ipipe-x86-4.19.y

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#5 lore raw

Am Mon, 24 Jun 2019 08:32:24 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 5 lines · Henning Schild via Xenomai
Quoted 4 lines

Hi Jan,

works fine. The only thing that did not was the gdb smokey test.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

FAILURE run_gdb:288: checking expression "primary_mode", expected "$", found "N"

did not look into where this came from.

OK, didn't see that so far. Did you only see this on 4.19 so far, ie. did you test 4.14 or older with master recently?

Switches from stable to master for just this one, so can not tell.

Quoted 6 lines
Quoted 3 lines

Tested todays master but think the 4.19 changes should be backported to stable as well.

I'm not planning for that due to the number of changes involved. 3.1 will come out "soon", and that is for newer kernels.

Ok.

Quoted 6 lines
Quoted 4 lines

I also ran into an smb issue from upstream, which is fixed there. So i think this should be rebased on latest 4.19 eventually. Or leave it on 33 and merge for the first release.

Which one exactly?

37, but is there anything from preventing 55?

Henning

Quoted 31 lines

Thanks,
Jan

Quoted 27 lines

Henning

Am Tue, 18 Jun 2019 18:37:14 +0200
schrieb Jan Kiszka via Xenomai <[email protected]>:

Quoted 18 lines

Hi all,

@all early adopters: There is a first version of upcoming x86 support based on the 4.19 kernel available at [1]. You need Xenomai master for it. The kernel should boot and run Xenomai workload fine - at least it does here so far. I only see one lockdep splat during early boot that needs to be sorted out. Possibly just an instrumentation issue, not a real problem. For the first release, cleaning up the series and adding latest 4.19 support are on my to-do list.

Early test reports appreciated!

Jan

[1]
https://gitlab.denx.de/Xenomai/ipipe-x86/commits/wip/ipipe-x86-4.19.y

author
#6 lore raw
Quoted 28 lines · Henning Schild

Am Mon, 24 Jun 2019 08:32:24 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 5 lines · Henning Schild via Xenomai
Quoted 4 lines

Hi Jan,

works fine. The only thing that did not was the gdb smokey test.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

FAILURE run_gdb:288: checking expression "primary_mode", expected "$", found "N"

did not look into where this came from.

OK, didn't see that so far. Did you only see this on 4.19 so far, ie. did you test 4.14 or older with master recently?

Switches from stable to master for just this one, so can not tell.

Quoted 6 lines
Quoted 3 lines

Tested todays master but think the 4.19 changes should be backported to stable as well.

I'm not planning for that due to the number of changes involved. 3.1 will come out "soon", and that is for newer kernels.

Ok.

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I also ran into an smb issue from upstream, which is fixed there. So i think this should be rebased on latest 4.19 eventually. Or leave it on 33 and merge for the first release.

Which one exactly?

37, but is there anything from preventing 55?

I was referring to the concrete issue, or commit. I will rebase, I just wanted to reduce the number of variables during the initial stabilization.

Jan

#7 lore raw

Am Mon, 24 Jun 2019 13:29:16 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 33 lines · Henning Schild
Quoted 32 lines

Am Mon, 24 Jun 2019 08:32:24 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 5 lines · Henning Schild via Xenomai
Quoted 4 lines

Hi Jan,

works fine. The only thing that did not was the gdb smokey test.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

FAILURE run_gdb:288: checking expression "primary_mode", expected "$", found "N"

did not look into where this came from.

OK, didn't see that so far. Did you only see this on 4.19 so far, ie. did you test 4.14 or older with master recently?

Switches from stable to master for just this one, so can not tell.

Quoted 6 lines
Quoted 3 lines

Tested todays master but think the 4.19 changes should be backported to stable as well.

I'm not planning for that due to the number of changes involved. 3.1 will come out "soon", and that is for newer kernels.

Ok.

Quoted 5 lines
Quoted 4 lines

I also ran into an smb issue from upstream, which is fixed there. So i think this should be rebased on latest 4.19 eventually. Or leave it on 33 and merge for the first release.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Which one exactly?

37, but is there anything from preventing 55?

I was referring to the concrete issue, or commit. I will rebase, I just wanted to reduce the number of variables during the initial stabilization.

upstream 088aaf17aa79300cab14dbee2569c58cfafd7d6e
stable c69330a855ab4342d304f67f8c1e7d1fa2686bec

Henning

Quoted 1 line

Jan

author
#8 lore raw
Quoted 38 lines · Henning Schild via Xenomai

Am Mon, 24 Jun 2019 13:29:16 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 35 lines · Henning Schild
Quoted 34 lines

Am Mon, 24 Jun 2019 08:32:24 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 5 lines · Henning Schild via Xenomai
Quoted 4 lines

Hi Jan,

works fine. The only thing that did not was the gdb smokey test.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

FAILURE run_gdb:288: checking expression "primary_mode", expected "$", found "N"

did not look into where this came from.

OK, didn't see that so far. Did you only see this on 4.19 so far, ie. did you test 4.14 or older with master recently?

Switches from stable to master for just this one, so can not tell.

Quoted 6 lines
Quoted 3 lines

Tested todays master but think the 4.19 changes should be backported to stable as well.

I'm not planning for that due to the number of changes involved. 3.1 will come out "soon", and that is for newer kernels.

Ok.

Quoted 6 lines
Quoted 4 lines

I also ran into an smb issue from upstream, which is fixed there. So i think this should be rebased on latest 4.19 eventually. Or leave it on 33 and merge for the first release.

Which one exactly?

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

37, but is there anything from preventing 55?

I was referring to the concrete issue, or commit. I will rebase, I just wanted to reduce the number of variables during the initial stabilization.

upstream 088aaf17aa79300cab14dbee2569c58cfafd7d6e
stable c69330a855ab4342d304f67f8c1e7d1fa2686bec

Ah, SMB - I've read SMP and was expecting some thrilling patch.

BTW, regarding the failing smokey gdb test: Check if gdb is available on the target. That is now a precondition.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#9 lore raw

Am Thu, 27 Jun 2019 18:50:30 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 45 lines · Henning Schild via Xenomai
Quoted 44 lines

Am Mon, 24 Jun 2019 13:29:16 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 40 lines · Henning Schild
Quoted 28 lines

Am Mon, 24 Jun 2019 08:32:24 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 5 lines · Henning Schild via Xenomai
Quoted 4 lines

Hi Jan,

works fine. The only thing that did not was the gdb smokey test.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

FAILURE run_gdb:288: checking expression "primary_mode", expected "$", found "N"

did not look into where this came from.

OK, didn't see that so far. Did you only see this on 4.19 so far, ie. did you test 4.14 or older with master recently?

Switches from stable to master for just this one, so can not tell.

Quoted 6 lines
Quoted 3 lines

Tested todays master but think the 4.19 changes should be backported to stable as well.

I'm not planning for that due to the number of changes involved. 3.1 will come out "soon", and that is for newer kernels.

Ok.

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I also ran into an smb issue from upstream, which is fixed there. So i think this should be rebased on latest 4.19 eventually. Or leave it on 33 and merge for the first release.

Which one exactly?

37, but is there anything from preventing 55?

I was referring to the concrete issue, or commit. I will rebase, I just wanted to reduce the number of variables during the initial stabilization.

Quoted 5 lines
Quoted 3 lines

upstream 088aaf17aa79300cab14dbee2569c58cfafd7d6e
stable c69330a855ab4342d304f67f8c1e7d1fa2686bec

Ah, SMB - I've read SMP and was expecting some thrilling patch.

And i was surprised you wanted to know so much about a smb KASAN fixup. Btw also in current 4.14 ...

Quoted 2 lines

BTW, regarding the failing smokey gdb test: Check if gdb is available on the target. That is now a precondition.

Yes it is. The $ N does not make any sense. It came from running a local copy without "make install". That is currently not supported by the gdb test, which should be fixed. People might want to test before installing, if just working on one machine.

After that i run into

Quoted 2 lines
Quoted 2 lines

FAILURE run_gdb:290: checking expression "primary_mode", expected "1", found "0

Henning

Quoted 2 lines

Jan

author
#10 lore raw
Quoted 7 lines · Henning Schild
Quoted 2 lines

BTW, regarding the failing smokey gdb test: Check if gdb is available on the target. That is now a precondition.

Yes it is. The $ N does not make any sense. It came from running a local copy without "make install". That is currently not supported by the gdb test, which should be fixed. People might want to test before installing, if just working on one machine.

This works fine here:

$ xenomai/build/testsuite/smokey/smokey --run=gdb
gdb OK
Quoted 5 lines

After that i run into

Quoted 2 lines
Quoted 2 lines

FAILURE run_gdb:290: checking expression "primary_mode", expected "1", found "0

Can't reproduce. And given that line 290 in master does not contain any code, I strongly suspect your build is inconsistent.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#11 lore raw

Am Fri, 28 Jun 2019 15:06:39 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 9 lines · Henning Schild
Quoted 7 lines
Quoted 2 lines

BTW, regarding the failing smokey gdb test: Check if gdb is available on the target. That is now a precondition.

Yes it is. The $ N does not make any sense. It came from running a local copy without "make install". That is currently not supported by the gdb test, which should be fixed. People might want to test before installing, if just working on one machine.

Quoted 4 lines

This works fine here:

$ xenomai/build/testsuite/smokey/smokey --run=gdb
gdb OK

Running local, in a rootfs not containing an old version? The problem is launching smokey again from gdb. In my case the old smokey did not even know about "gdb".

Quoted 8 lines
Quoted 5 lines

After that i run into

Quoted 2 lines
Quoted 2 lines

FAILURE run_gdb:290: checking expression "primary_mode", expected "1", found "0

Can't reproduce. And given that line 290 in master does not contain any code, I strongly suspect your build is inconsistent.

Off by two debug printfs that did not cause the problem. 288 in a clean copy ... a "make install" was required to get rid of the 290.

Henning

Quoted 2 lines

Jan

author
#12 lore raw
Quoted 12 lines · Henning Schild

Am Fri, 28 Jun 2019 15:06:39 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 9 lines · Henning Schild
Quoted 7 lines
Quoted 2 lines

BTW, regarding the failing smokey gdb test: Check if gdb is available on the target. That is now a precondition.

Yes it is. The $ N does not make any sense. It came from running a local copy without "make install". That is currently not supported by the gdb test, which should be fixed. People might want to test before installing, if just working on one machine.

Quoted 9 lines
Quoted 4 lines

This works fine here:

$ xenomai/build/testsuite/smokey/smokey --run=gdb
gdb OK

Running local, in a rootfs not containing an old version? The problem is launching smokey again from gdb. In my case the old smokey did not even know about "gdb".

OK, I think I got it now. This should fix both issues:

testsuite/smokey/gdb/gdb.c +1 -2
index 2fad3da19a..a6909d595b 100644
@@ -274,8 +274,7 @@ static int run_gdb(struct smokey_test *t, int argc, char *const argv[])
 			snprintf(run_param, sizeof(run_param), "--run=%d",
 				 t->__reserved.id);
 			execl("/usr/bin/gdb", "gdb", "--args",
-			      CONFIG_XENO_PREFIX "/bin/smokey", run_param,
-			      "run_target", NULL);
+			      argv[0], run_param, "run_target", NULL);
 			_exit(ESRCH);
 
 		default:

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#13 lore raw

Am Fri, 28 Jun 2019 16:00:17 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 41 lines · Henning Schild
Quoted 12 lines

Am Fri, 28 Jun 2019 15:06:39 +0200
schrieb Jan Kiszka <[email protected]>:

Quoted 9 lines · Henning Schild
Quoted 7 lines
Quoted 2 lines

BTW, regarding the failing smokey gdb test: Check if gdb is available on the target. That is now a precondition.

Yes it is. The $ N does not make any sense. It came from running a local copy without "make install". That is currently not supported by the gdb test, which should be fixed. People might want to test before installing, if just working on one machine.

Quoted 9 lines
Quoted 4 lines

This works fine here:

$ xenomai/build/testsuite/smokey/smokey --run=gdb
gdb OK  

Running local, in a rootfs not containing an old version? The problem is launching smokey again from gdb. In my case the old smokey did not even know about "gdb".

OK, I think I got it now. This should fix both issues:

testsuite/smokey/gdb/gdb.c +1 -2
index 2fad3da19a..a6909d595b 100644
@@ -274,8 +274,7 @@ static int run_gdb(struct smokey_test *t, int
 argc, char *const argv[]) snprintf(run_param, sizeof(run_param),
 "--run=%d", t->__reserved.id);
 			execl("/usr/bin/gdb", "gdb", "--args",
-			      CONFIG_XENO_PREFIX "/bin/smokey",
 run_param,
-			      "run_target", NULL);
+			      argv[0], run_param, "run_target",
 NULL); _exit(ESRCH);
 

default:

Quoted 1 line

Jan

That solves the one problem, but the test still fails. I further investigated and it has to be one of the following kernel options that allowed me to finally run it successfully.

--- /boot/config-4.14.128-henning+.old 2019-06-27 14:36:43.299983371 +0000
+++ /boot/config-4.14.128-henning+ 2019-06-28 13:23:43.569874713 +0000

#
# Latency settings
@@ -455,11 +456,16 @@
CONFIG_XENO_OPT_TIMING_KSCHEDLAT=0
CONFIG_XENO_OPT_TIMING_IRQLAT=0
CONFIG_XENO_OPT_DEBUG=y
-# CONFIG_XENO_OPT_DEBUG_COBALT is not set
-# CONFIG_XENO_OPT_DEBUG_CONTEXT is not set
+CONFIG_XENO_OPT_DEBUG_COBALT=y
+# CONFIG_XENO_OPT_DEBUG_MEMORY is not set
+CONFIG_XENO_OPT_DEBUG_CONTEXT=y
CONFIG_XENO_OPT_DEBUG_LOCKING=y
-# CONFIG_XENO_OPT_DEBUG_USER is not set
-# CONFIG_XENO_OPT_DEBUG_TRACE_RELAX is not set
+CONFIG_XENO_OPT_DEBUG_USER=y
+CONFIG_XENO_OPT_DEBUG_MUTEX_RELAXED=y
+CONFIG_XENO_OPT_DEBUG_MUTEX_SLEEP=y
+CONFIG_XENO_OPT_DEBUG_POSIX_SYNCHRO=y
+CONFIG_XENO_OPT_DEBUG_LEGACY=y
+CONFIG_XENO_OPT_DEBUG_TRACE_RELAX=y
CONFIG_XENO_OPT_WATCHDOG=y
CONFIG_XENO_OPT_WATCHDOG_TIMEOUT=4