Skip to contentSkip to conversation

I-pipe house cleaning

PATCH In review Jan Kiszka 2 participants 25 messages Sep 3, 2023 – Sep 4, 2023

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

cover I-pipe house cleaning

Initially, I just ran into the "Revisit: I-pipe requirement" comment on the lostage_signal self field. But then I did a systematic search for i[-]pipe and found way more. This is the result which should only make things (minimally) faster and otherwise simply remove now dead code.

Jan

Jan Kiszka (20):
cobalt: Drop self element from lostage_signal drivers/udd: Drop self element from irqswitch_work
cobalt: Drop not longer supported CONFIG_XENO_OPT_STATS_IRQS testsuite/smokey/y2038: Activate minimal clock_settime64 testsuite/clocktest: Drop obsolete CLOCK_HOST_REALTIME and wallclock
offset bits
testsuite/smokey: Remove VDSO test
lib/cobalt: Drop legacy_tsc code for I-pipe
lib/cobalt: Drop tsc.h
cobalt/uapi: Drop tsc.h
lib/cobalt: Drop VDSO support
kernel/cobalt: Remove archcall syscall stub kernel/cobalt: Retire clock_freq field in cobalt_featinfo kernel/cobalt: Remove VDSO support
testsuite/smokey/rtdm: Remove dead code
lib/cobalt: Refactor cobalt_read_tsc API to cobalt_read_ns lib/copperplate: Refactor clockobj_get_tsc API to clockobj_get_ns scripts/Kconfig.frag: Switch to I-pipe only include/cobalt: Fix inclusion guard names
ci: Update comment
cobalt/posix: Update comment

 .gitlab-ci.yml                                |   2 +-
 configure.ac                                  |   1 -
 include/cobalt/kernel/Makefile.am             |   1 -
 .../kernel/dovetail/pipeline/pipeline.h       |   5 -
 .../cobalt/kernel/dovetail/pipeline/tick.h    |   6 +-
 include/cobalt/kernel/intr.h                  |  30 -----
 include/cobalt/kernel/thread.h                |   1 -
 include/cobalt/kernel/vdso.h                  |  49 -------
 include/cobalt/sys/cobalt.h                   |   3 +-
 include/cobalt/ticks.h                        |  49 -------
 include/cobalt/uapi/asm-generic/features.h    |   8 +-
 include/cobalt/uapi/kernel/Makefile.am        |   4 +-
 include/cobalt/uapi/kernel/urw.h              | 113 ----------------
 include/cobalt/uapi/kernel/vdso.h             |  66 ----------
 include/cobalt/uapi/syscall.h                 |   2 +-
 include/copperplate/clockobj.h                |  35 +----
 kernel/cobalt/Kconfig                         |  12 --
 .../arch/arm/include/asm/xenomai/syscall.h    |   9 --
 .../arm/include/asm/xenomai/uapi/features.h   |   1 -
 .../arch/arm/include/asm/xenomai/uapi/tsc.h   |  25 ----
 .../arch/arm64/include/asm/xenomai/syscall.h  |   9 --
 .../arm64/include/asm/xenomai/uapi/features.h |   2 -
 .../arch/arm64/include/asm/xenomai/uapi/tsc.h |  25 ----
 .../arch/x86/include/asm/xenomai/syscall.h    |   8 --
 .../x86/include/asm/xenomai/uapi/features.h   |   1 -
 kernel/cobalt/clock.c                         |   2 -
 kernel/cobalt/dovetail/kevents.c              |   1 -
 kernel/cobalt/init.c                          |   1 -
 kernel/cobalt/posix/memory.c                  |  21 ---
 kernel/cobalt/posix/process.c                 |   5 +-
 kernel/cobalt/posix/syscall.c                 |  12 --
 kernel/cobalt/sched.c                         |  51 +------
 kernel/cobalt/thread.c                        |   6 -
 kernel/cobalt/trace/cobalt-posix.h            |   1 -
 kernel/drivers/udd/udd.c                      |   4 +-
 lib/cobalt/arch/arm/features.c                |  46 -------
 .../arch/arm/include/asm/xenomai/Makefile.am  |   3 +-
 lib/cobalt/arch/arm/include/asm/xenomai/tsc.h |  48 -------
 lib/cobalt/arch/arm64/features.c              |  42 ------
 .../arm64/include/asm/xenomai/Makefile.am     |   3 +-
 .../arch/arm64/include/asm/xenomai/tsc.h      |  54 --------
 .../arch/x86/include/asm/xenomai/Makefile.am  |   3 +-
 lib/cobalt/arch/x86/include/asm/xenomai/tsc.h |  38 ------
 lib/cobalt/clock.c                            | 124 +++---------------
 lib/cobalt/init.c                             |   4 +-
 lib/cobalt/internal.c                         |   6 +-
 lib/cobalt/internal.h                         |   2 +-
 lib/cobalt/ticks.c                            |  70 +---------
 lib/cobalt/umm.c                              |  14 +-
 lib/cobalt/umm.h                              |   6 +-
 lib/copperplate/clockobj.c                    |   8 +-
 lib/copperplate/threadobj.c                   |   4 +-
 lib/psos/tm.c                                 |   2 +-
 scripts/Kconfig.frag                          |   6 +-
 testsuite/clocktest/clocktest.c               |  64 +--------
 testsuite/smokey/Makefile.am                  |   2 -
 testsuite/smokey/arith/arith.c                |   6 +-
 testsuite/smokey/posix-cond/posix-cond.c      |  46 +++----
 testsuite/smokey/rtdm/rtdm.c                  |  12 --
 testsuite/smokey/tsc/tsc.c                    |  37 +-----
 testsuite/smokey/vdso-access/Makefile.am      |   9 --
 testsuite/smokey/vdso-access/vdso-access.c    |  31 -----
 testsuite/smokey/y2038/syscall-tests.c        |  30 -----
 63 files changed, 99 insertions(+), 1192 deletions(-)
 delete mode 100644 include/cobalt/kernel/vdso.h
 delete mode 100644 include/cobalt/uapi/kernel/urw.h
 delete mode 100644 include/cobalt/uapi/kernel/vdso.h
 delete mode 100644 kernel/cobalt/arch/arm/include/asm/xenomai/uapi/tsc.h
 delete mode 100644 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/tsc.h
 delete mode 100644 lib/cobalt/arch/arm/include/asm/xenomai/tsc.h
 delete mode 100644 lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h
 delete mode 100644 lib/cobalt/arch/x86/include/asm/xenomai/tsc.h
 delete mode 100644 testsuite/smokey/vdso-access/Makefile.am
 delete mode 100644 testsuite/smokey/vdso-access/vdso-access.c
Signature · 1 line
2.35.3
author
#1 lore raw

PATCH 1/20 cobalt: Drop self element from lostage_signal

From: Jan Kiszka <[email protected]>

This was only needed for I-pipe which was dropped.

---
 include/cobalt/kernel/thread.h | 1 -
 kernel/cobalt/thread.c         | 6 ------
 2 files changed, 7 deletions(-)
include/cobalt/kernel/thread.h +0 -1
index b79cb84296..7f9a37d29a 100644
@@ -62,7 +62,6 @@ struct lostage_signal {
 	struct pipeline_inband_work inband_work; /* Must be first. */
 	struct task_struct *task;
 	int signo, sigval;
-	struct lostage_signal *self; /* Revisit: I-pipe requirement */
 };
 
 struct xnthread_init_attr {
kernel/cobalt/thread.c +0 -6
index 41804b24fc..cf3b4dbb0e 100644
@@ -2162,11 +2162,6 @@ static void lostage_task_signal(struct pipeline_inband_work *inband_work)
 	spl_t s;
 
 	rq = container_of(inband_work, struct lostage_signal, inband_work);
-	/*
-	 * Revisit: I-pipe requirement. It passes a copy of the original work
-	 * struct, so retrieve the original one first in order to update is.
-	 */
-	rq = rq->self;
 
 	xnlock_get_irqsave(&nklock, s);
 
@@ -2396,7 +2391,6 @@ void __xnthread_signal(struct xnthread *thread, int sig, int arg)
 	sigwork->task = xnthread_host_task(thread);
 	sigwork->signo = sig;
 	sigwork->sigval = sig == SIGDEBUG ? arg | sigdebug_marker : arg;
-	sigwork->self = sigwork; /* Revisit: I-pipe requirement */
 
 	trace_cobalt_lostage_request("signal", sigwork->task);
 
Signature · 1 line
2.35.3
author
#2 lore raw

PATCH 2/20 drivers/udd: Drop self element from irqswitch_work

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This was only needed for I-pipe which was dropped.

---
 kernel/drivers/udd/udd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/drivers/udd/udd.c +1 -3
index 958208ec7e..b1efcebd0f 100644
@@ -520,7 +520,6 @@ struct irqswitch_work {
 	rtdm_irq_t *irqh;
 	int enabled;
 	rtdm_event_t *done;
-	struct irqswitch_work *self; /* Revisit: I-pipe requirement */
 };
 
 static void lostage_irqswitch_line(struct pipeline_inband_work *inband_work)
@@ -540,7 +539,7 @@ static void lostage_irqswitch_line(struct pipeline_inband_work *inband_work)
 	if (rq->done)
 		rtdm_event_signal(rq->done);
 
-	xnfree(rq->self);
+	xnfree(rq);
 }
 
 static void switch_irq_line(rtdm_irq_t *irqh, int enable, rtdm_event_t *done)
@@ -556,7 +555,6 @@ static void switch_irq_line(rtdm_irq_t *irqh, int enable, rtdm_event_t *done)
 	rq->irqh = irqh;
 	rq->enabled = enable;
 	rq->done = done;
-	rq->self = rq;	/* Revisit: I-pipe requirement */
 
 	/*
 	 * Not pretty, but we may not traverse the kernel code for
Signature · 1 line
2.35.3
author
#7 lore raw

PATCH 5/20 testsuite/clocktest: Drop obsolete CLOCK_HOST_REALTIME and wallclock offset bits

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This clock was retired with the removal of I-pipe support. Along with it, wallclock offset support became obsolete.

---
 testsuite/clocktest/clocktest.c | 64 ++-------------------------------
 1 file changed, 2 insertions(+), 62 deletions(-)
testsuite/clocktest/clocktest.c +2 -62
index c524f42fb7..c2b9ee5f43 100644
@@ -31,11 +31,8 @@
 #include <sys/time.h>
 #include <boilerplate/ancillaries.h>
 #include <boilerplate/atomic.h>
-#include <cobalt/uapi/kernel/vdso.h>
 #include <xeno_config.h>
 
-extern struct xnvdso *cobalt_vdso;
-
 /*
  * We can't really trust POSIX headers to check for features, since
  * some archs may not implement all of the declared uClibc POSIX
@@ -67,44 +64,6 @@ struct per_cpu_data {
 	pthread_t thread;
 } *per_cpu_data;
 
-static void show_hostrt_diagnostics(void)
-{
-	if (!xnvdso_test_feature(cobalt_vdso, XNVDSO_FEAT_HOST_REALTIME)) {
-		printf("XNVDSO_FEAT_HOST_REALTIME not available\n");
-		return;
-	}
-
-	if (cobalt_vdso->hostrt_data.live)
-		printf("hostrt data area is live\n");
-	else {
-		printf("hostrt data area is not live\n");
-		return;
-	}
-
-	printf("sequence counter : %u\n",
-	       cobalt_vdso->hostrt_data.lock.sequence);
-	printf("wall_time_sec    : %lld\n",
-	       (unsigned long long)cobalt_vdso->hostrt_data.wall_sec);
-	printf("wall_time_nsec   : %u\n", cobalt_vdso->hostrt_data.wall_nsec);
-	printf("wall_to_monotonic_sec    : %lld\n",
-	       (unsigned long long)cobalt_vdso->hostrt_data.wtom_sec);
-	printf("wall_to_monotonic_nsec   : %u\n", cobalt_vdso->hostrt_data.wtom_nsec);
-	printf("cycle_last       : %Lu\n", (long long)cobalt_vdso->hostrt_data.cycle_last);
-	printf("mask             : 0x%Lx\n", (long long)cobalt_vdso->hostrt_data.mask);
-	printf("mult             : %u\n", cobalt_vdso->hostrt_data.mult);
-	printf("shift            : %u\n\n", cobalt_vdso->hostrt_data.shift);
-}
-
-static void show_realtime_offset(void)
-{
-	if (!xnvdso_test_feature(cobalt_vdso, XNVDSO_FEAT_HOST_REALTIME)) {
-		printf("XNVDSO_FEAT_WALLCLOCK_OFFSET not available\n");
-		return;
-	}
-
-	printf("Wallclock offset : %llu\n", (long long)cobalt_vdso->wallclock_offset);
-}
-
 static inline uint64_t read_clock(clockid_t clock_id)
 {
 	struct timespec ts;
@@ -114,11 +73,6 @@ static inline uint64_t read_clock(clockid_t clock_id)
 	if (res != 0) {
 		fprintf(stderr, "clock_gettime failed for clock id %d\n",
 			clock_id);
-		if (clock_id == CLOCK_HOST_REALTIME)
-			show_hostrt_diagnostics();
-		else if (clock_id == CLOCK_REALTIME)
-			show_realtime_offset();
-
 		exit(-1);
 	}
 	return ts.tv_nsec + ts.tv_sec * 1000000000ULL;
@@ -249,9 +203,6 @@ static clockid_t resolve_clock_name(const char *name,
 			case CLOCK_MONOTONIC_RAW:
 				*real_name = "CLOCK_MONOTONIC_RAW";
 				break;
-			case CLOCK_HOST_REALTIME:
-				*real_name = "CLOCK_HOST_REALTIME";
-				break;
 			default:
 				error(1, EINVAL, "bad built-in clock id '%d'",
 				      clock_id);
@@ -264,8 +215,6 @@ static clockid_t resolve_clock_name(const char *name,
 			return CLOCK_MONOTONIC;
 		if (strcmp(name, "CLOCK_MONOTONIC_RAW") == 0)
 			return CLOCK_MONOTONIC_RAW;
-		if (strcmp(name, "CLOCK_HOST_REALTIME") == 0)
-			return CLOCK_HOST_REALTIME;
 		if (strcmp(name, "coreclk") == 0) {
 			/* Read the core clock as CLOCK_MONOTONIC_RAW */
 			*real_name = "CLOCK_MONOTONIC_RAW";
@@ -303,10 +252,9 @@ int main(int argc, char *argv[])
 	int max_cpu, cpus;
 	int i;
 	int c;
-	int d = 0;
 	int ext = 0;
 
-	while ((c = getopt(argc, argv, "C:ET:D")) != EOF)
+	while ((c = getopt(argc, argv, "C:ET:")) != EOF)
 		switch (c) {
 		case 'C':
 			clock_name = optarg;
@@ -320,16 +268,11 @@ int main(int argc, char *argv[])
 			alarm(atoi(optarg));
 			break;
 
-		case 'D':
-			d = 1;
-			break;
-
 		default:
 			fprintf(stderr, "usage: clocktest [options]\n"
 				"  [-C <clock_id|clock_name>]   # tested clock, defaults to CLOCK_REALTIME\n"
 				"  [-E]                         # -C specifies extension clock\n"
-				"  [-T <test_duration_seconds>] # default=0, so ^C to end\n"
-				"  [-D]                         # print extra diagnostics for CLOCK_HOST_REALTIME\n");
+				"  [-T <test_duration_seconds>] # default=0, so ^C to end\n");
 			exit(2);
 		}
 
@@ -340,9 +283,6 @@ int main(int argc, char *argv[])
 
 	init_lock(&lock);
 
-	if (d && clock_id == CLOCK_HOST_REALTIME)
-		show_hostrt_diagnostics();
-
 	if (get_realtime_cpu_set(&cpu_realtime_set) != 0)
 		error(1, ENOSYS, "get_realtime_cpu_set");
 
Signature · 1 line
2.35.3
author
#8 lore raw

PATCH 6/20 testsuite/smokey: Remove VDSO test

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

The Xenomai VDSO is about to be removed.

---
 configure.ac                               |  1 -
 testsuite/smokey/Makefile.am               |  2 --
 testsuite/smokey/vdso-access/Makefile.am   |  9 -------
 testsuite/smokey/vdso-access/vdso-access.c | 31 ----------------------
 4 files changed, 43 deletions(-)
 delete mode 100644 testsuite/smokey/vdso-access/Makefile.am
 delete mode 100644 testsuite/smokey/vdso-access/vdso-access.c
configure.ac +0 -1
index a601f94cd3..86dd8ba4f8 100644
@@ -1015,7 +1015,6 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/sched-tp/Makefile \
 	testsuite/smokey/setsched/Makefile \
 	testsuite/smokey/rtdm/Makefile \
-	testsuite/smokey/vdso-access/Makefile \
 	testsuite/smokey/posix-cond/Makefile \
 	testsuite/smokey/posix-mutex/Makefile \
 	testsuite/smokey/posix-clock/Makefile \
testsuite/smokey/Makefile.am +0 -2
index b7654682d5..c49a5d77f0 100644
@@ -38,7 +38,6 @@ COBALT_SUBDIRS = 	\
 	sigdebug	\
 	timerfd		\
 	tsc		\
-	vdso-access 	\
 	xddp		\
 	y2038		\
 	alchemytests	\
@@ -84,7 +83,6 @@ DIST_SUBDIRS = 		\
 	sigdebug	\
 	timerfd		\
 	tsc		\
-	vdso-access 	\
 	xddp		\
 	y2038		\
 	alchemytests	\
testsuite/smokey/vdso-access/Makefile.am deleted +0 -9
deleted file mode 100644
index 250ef08400..0000000000
@@ -1,9 +0,0 @@
-
-noinst_LIBRARIES = libvdso-access.a
-
-libvdso_access_a_SOURCES = vdso-access.c
-
-libvdso_access_a_CPPFLAGS = 	\
-	@XENO_USER_CFLAGS@	\
-	-I$(top_srcdir)		\
-	-I$(top_srcdir)/include
testsuite/smokey/vdso-access/vdso-access.c deleted +0 -31
deleted file mode 100644
index 42c1b28f72..0000000000
@@ -1,31 +0,0 @@
-/*
- * VDSO feature set testcase
- * by Wolfgang Mauerer <[email protected]>
- */
-#include <stdio.h>
-#include <time.h>
-#include <boilerplate/atomic.h>
-#include <cobalt/uapi/kernel/vdso.h>
-#include <smokey/smokey.h>
-
-smokey_test_plugin(vdso_access,
-		   SMOKEY_NOARGS,
-		   "Check VDSO access."
-);
-
-extern void *cobalt_umm_shared;
-
-extern struct xnvdso *cobalt_vdso;
-
-int run_vdso_access(struct smokey_test *t, int argc, char *const argv[])
-{
-	if (cobalt_umm_shared == NULL) {
-		warning("could not determine position of the VDSO segment");
-		return 1;
-	}
-
-	smokey_trace("VDSO: features detected: %llx",
-		     (long long)cobalt_vdso->features);
-
-	return 0;
-}
Signature · 1 line
2.35.3
author
#9 lore raw

PATCH 7/20 lib/cobalt: Drop legacy_tsc code for I-pipe

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

With I-pipe support removed, cobalt_use_legacy_tsc is now always false because the kernel will report 0 as clock_freq. Drop code that was guarded by this runtime check. This obsoletes XNARCH_HAVE_LLMULSHFT. Furthermoe fold gettime_via_vdso directly into clock_gettime as the only possible case now.

---
 include/cobalt/ticks.h                        |  31 -----
 .../arm/include/asm/xenomai/uapi/features.h   |   1 -
 .../arm64/include/asm/xenomai/uapi/features.h |   2 -
 .../x86/include/asm/xenomai/uapi/features.h   |   1 -
 lib/cobalt/arch/arm/features.c                |  46 -------
 lib/cobalt/arch/arm64/features.c              |  42 ------
 lib/cobalt/clock.c                            | 124 +++---------------
 lib/cobalt/init.c                             |   2 +-
 lib/cobalt/internal.c                         |   4 -
 lib/cobalt/internal.h                         |   2 +-
 lib/cobalt/ticks.c                            |  70 +---------
 11 files changed, 28 insertions(+), 297 deletions(-)
include/cobalt/ticks.h +0 -31
index e59d86d499..fe5a6ac21a 100644
@@ -21,56 +21,25 @@
 #include <stdbool.h>
 #include <cobalt/uapi/kernel/types.h>
 
-/*
- * Depending on the underlying pipeline support, we may represent time
- * stamps as count of nanoseconds (Dovetail), or as values of the
- * hardware tick counter (aka TSC) available with the platform
- * (I-pipe). In the latter - legacy - case, we need to convert from
- * TSC values to nanoseconds and conversely via scaled maths. This
- * indirection will go away once support for the I-pipe is removed.
- */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern unsigned long long __cobalt_tsc_clockfreq;
-
-static inline bool cobalt_use_legacy_tsc(void)
-{
-	return !!__cobalt_tsc_clockfreq;
-}
-
-xnsticks_t __cobalt_tsc_to_ns(xnsticks_t ticks);
-
-xnsticks_t __cobalt_tsc_to_ns_rounded(xnsticks_t ticks);
-
-xnsticks_t __cobalt_ns_to_tsc(xnsticks_t ns);
-
 static inline
 xnsticks_t cobalt_ns_to_ticks(xnsticks_t ns)
 {
-	if (cobalt_use_legacy_tsc())
-		return __cobalt_ns_to_tsc(ns);
-
 	return ns;
 }
 
 static inline
 xnsticks_t cobalt_ticks_to_ns(xnsticks_t ticks)
 {
-	if (cobalt_use_legacy_tsc())
-		return __cobalt_tsc_to_ns(ticks);
-
 	return ticks;
 }
 
 static inline
 xnsticks_t cobalt_ticks_to_ns_rounded(xnsticks_t ticks)
 {
-	if (cobalt_use_legacy_tsc())
-		return __cobalt_tsc_to_ns_rounded(ticks);
-
 	return ticks;
 }
 
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h +0 -1
index fdd5c0e327..4a87c67329 100644
@@ -28,7 +28,6 @@
 
 #define XENOMAI_FEAT_MAN (__xn_feat_generic_man_mask)
 
-#define XNARCH_HAVE_LLMULSHFT    1
 #define XNARCH_HAVE_NODIV_LLIMD  1
 
 struct cobalt_featinfo_archdep { /* no arch-specific feature */ };
kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h +0 -2
index 301797748c..fba1db391b 100644
@@ -28,8 +28,6 @@
 
 #define XENOMAI_FEAT_MAN (__xn_feat_generic_man_mask)
 
-#undef XNARCH_HAVE_LLMULSHFT
-
 #undef XNARCH_HAVE_NODIV_LLIMD
 
 struct cobalt_featinfo_archdep { /* no arch-specific feature */ };
kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h +0 -1
index 045adf0c1c..554dc249cb 100644
@@ -25,7 +25,6 @@
 
 #define XENOMAI_FEAT_MAN  __xn_feat_generic_man_mask
 
-#define XNARCH_HAVE_LLMULSHFT    1
 #define XNARCH_HAVE_NODIV_LLIMD  1
 
 struct cobalt_featinfo_archdep { /* no arch-specific feature */ };
lib/cobalt/arch/arm/features.c +0 -46

58 lines not on this page · raw message

lib/cobalt/arch/arm64/features.c +0 -42

54 lines not on this page · raw message

lib/cobalt/clock.c +21 -103

155 lines not on this page · raw message

lib/cobalt/init.c +1 -1
index dcd63cad8e..58051a2f26 100644
@@ -177,7 +177,7 @@ static void low_init(void)
 		early_panic("mlockall: %s", strerror(errno));
 
 	trace_me("memory locked");
-	cobalt_ticks_init(f->clock_freq);
+	cobalt_ticks_init();
 	cobalt_features_init(f);
 	cobalt_init_umm(f->vdso_offset);
 	trace_me("memory heaps mapped");
lib/cobalt/internal.c +0 -4
index bf1e940b71..74b5bd8350 100644
@@ -31,7 +31,6 @@
 #include <stdarg.h>
 #include <pthread.h>
 #include <asm/xenomai/syscall.h>
-#include <asm/xenomai/tsc.h>
 #include <cobalt/ticks.h>
 #include <cobalt/sys/cobalt.h>
 #include "internal.h"
@@ -581,9 +580,6 @@ unsigned long long cobalt_read_tsc(void)
 {
 	struct timespec ts;
 
-	if (cobalt_use_legacy_tsc())
-		return cobalt_read_legacy_tsc();
-
 	__cobalt_vdso_gettime(CLOCK_MONOTONIC, &ts);
 
 	return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
lib/cobalt/internal.h +1 -1
index 00f51fa23d..049ab3fc4d 100644
@@ -82,7 +82,7 @@ void cobalt_print_init(void);
 
 void cobalt_print_init_atfork(void);
 
-void cobalt_ticks_init(unsigned long long freq);
+void cobalt_ticks_init(void);
 
 void cobalt_mutex_init(void);
 
lib/cobalt/ticks.c +5 -65

102 lines not on this page · raw message

Signature · 1 line
2.35.3
author
#10 lore raw

PATCH 8/20 lib/cobalt: Drop tsc.h

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

Was providing cobalt_read_legacy_tsc which is no longer used.

---
 .../arch/arm/include/asm/xenomai/Makefile.am  |  3 +-
 lib/cobalt/arch/arm/include/asm/xenomai/tsc.h | 48 -----------------
 .../arm64/include/asm/xenomai/Makefile.am     |  3 +-
 .../arch/arm64/include/asm/xenomai/tsc.h      | 54 -------------------
 .../arch/x86/include/asm/xenomai/Makefile.am  |  3 +-
 lib/cobalt/arch/x86/include/asm/xenomai/tsc.h | 38 -------------
 6 files changed, 3 insertions(+), 146 deletions(-)
 delete mode 100644 lib/cobalt/arch/arm/include/asm/xenomai/tsc.h
 delete mode 100644 lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h
 delete mode 100644 lib/cobalt/arch/x86/include/asm/xenomai/tsc.h
lib/cobalt/arch/arm/include/asm/xenomai/Makefile.am +1 -2
index d308b06e62..a7dd090432 100644
@@ -1,5 +1,4 @@
 
 noinst_HEADERS =	\
 	features.h	\
-	syscall.h	\
-	tsc.h
+	syscall.h
lib/cobalt/arch/arm/include/asm/xenomai/tsc.h deleted +0 -48

48 lines not on this page · raw message

lib/cobalt/arch/arm64/include/asm/xenomai/Makefile.am +1 -2
index d308b06e62..a7dd090432 100644
@@ -1,5 +1,4 @@
 
 noinst_HEADERS =	\
 	features.h	\
-	syscall.h	\
-	tsc.h
+	syscall.h
lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h deleted +0 -54

54 lines not on this page · raw message

lib/cobalt/arch/x86/include/asm/xenomai/Makefile.am +1 -2
index d308b06e62..a7dd090432 100644
@@ -1,5 +1,4 @@
 
 noinst_HEADERS =	\
 	features.h	\
-	syscall.h	\
-	tsc.h
+	syscall.h
lib/cobalt/arch/x86/include/asm/xenomai/tsc.h deleted +0 -38
deleted file mode 100644
index bf400e8505..0000000000
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2001,2002,2003,2007 Philippe Gerum <[email protected]>.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-
-#ifndef _LIB_COBALT_X86_TSC_H
-#define _LIB_COBALT_X86_TSC_H
-
-static inline unsigned long long cobalt_read_legacy_tsc(void)
-{
-#ifdef __i386__
-	unsigned long long t;
-
-	__asm__ __volatile__ ("rdtsc" : "=A" (t));
-	return t;
-
-#else /* x86_64 */
-	unsigned int __a,__d;
-
-	__asm__ __volatile__ ("rdtsc" : "=a" (__a), "=d" (__d));
-	return ((unsigned long)__a) | (((unsigned long)__d) << 32);
-#endif /* x86_64 */
-}
-
-#endif /* !_LIB_COBALT_X86_TSC_H */
Signature · 1 line
2.35.3
author
#11 lore raw

PATCH 9/20 cobalt/uapi: Drop tsc.h

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

No longer used.

---
 .../arch/arm/include/asm/xenomai/uapi/tsc.h   | 25 -------------------
 .../arch/arm64/include/asm/xenomai/uapi/tsc.h | 25 -------------------
 2 files changed, 50 deletions(-)
 delete mode 100644 kernel/cobalt/arch/arm/include/asm/xenomai/uapi/tsc.h
 delete mode 100644 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/tsc.h
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/tsc.h deleted +0 -25
deleted file mode 100644
index b17cfb24fc..0000000000
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2013 Gilles Chanteperdrix <[email protected]>.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-#ifndef _COBALT_ARM_ASM_UAPI_TSC_H
-#define _COBALT_ARM_ASM_UAPI_TSC_H
-
-struct __xn_tscinfo {
-	volatile unsigned int *counter;
-};
-
-#endif /* !_COBALT_ARM_ASM_UAPI_TSC_H */
kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/tsc.h deleted +0 -25
deleted file mode 100644
index 20a4eaa882..0000000000
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2013 Gilles Chanteperdrix <[email protected]>.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-#ifndef _COBALT_ARM64_ASM_UAPI_TSC_H
-#define _COBALT_ARM64_ASM_UAPI_TSC_H
-
-struct __xn_tscinfo {
-	volatile unsigned int *counter;
-};
-
-#endif /* !_COBALT_ARM64_ASM_UAPI_TSC_H */
Signature · 1 line
2.35.3
author
#12 lore raw

PATCH 10/20 lib/cobalt: Drop VDSO support

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This only existed to provide clock services under I-pipe. There are no other use cases in sight, so drop the related code from userspace first.

---
 lib/cobalt/init.c |  2 +-
 lib/cobalt/umm.c  | 14 +++-----------
 lib/cobalt/umm.h  |  6 +-----
 3 files changed, 5 insertions(+), 17 deletions(-)
lib/cobalt/init.c +1 -1
index 58051a2f26..7aa7c48de7 100644
@@ -179,7 +179,7 @@ static void low_init(void)
 	trace_me("memory locked");
 	cobalt_ticks_init();
 	cobalt_features_init(f);
-	cobalt_init_umm(f->vdso_offset);
+	cobalt_init_umm();
 	trace_me("memory heaps mapped");
 	cobalt_init_current_keys();
 }
lib/cobalt/umm.c +3 -11
index c30ada6a23..555bee8474 100644
@@ -34,8 +34,6 @@
 #include "umm.h"
 #include "internal.h"
 
-struct xnvdso *cobalt_vdso;
-
 void *cobalt_umm_private = NULL;
 
 void *cobalt_umm_shared = NULL;
@@ -117,20 +115,14 @@ static void init_bind(void)
 }
 
 /* Will be called only once, upon call to xenomai_init(). */
-static void init_loadup(__u32 vdso_offset)
+void cobalt_init_umm(void)
 {
 	uint32_t size;
 
+	pthread_once(&init_bind_once, init_bind);
+
 	cobalt_umm_shared = map_umm(COBALT_MEMDEV_SHARED, &size);
 	if (cobalt_umm_shared == MAP_FAILED)
 		early_panic("cannot map shared umm area: %s",
 			    strerror(errno));
-
-	cobalt_vdso = (struct xnvdso *)(cobalt_umm_shared + vdso_offset);
-}
-
-void cobalt_init_umm(__u32 vdso_offset)
-{
-	pthread_once(&init_bind_once, init_bind);
-	init_loadup(vdso_offset);
 }
lib/cobalt/umm.h +1 -5
index b592968832..7705f9cf94 100644
@@ -20,12 +20,8 @@
 
 #include <linux/types.h>
 
-void cobalt_init_umm(__u32 vdso_offset);
+void cobalt_init_umm(void);
 
 void cobalt_unmap_umm(void);
 
-struct xnvdso;
-
-extern struct xnvdso *cobalt_vdso;
-
 #endif /* _LIB_COBALT_UMM_H */
Signature · 1 line
2.35.3
author
#14 lore raw

PATCH 12/20 kernel/cobalt: Retire clock_freq field in cobalt_featinfo

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

Was always 0 since I-pipe was removed, and userspace no longer expects it with the latest ABI revision.

Keep the field as reserved so that older userspace still finds the ABI revision at the same offset.

---
 include/cobalt/kernel/dovetail/pipeline/pipeline.h | 5 -----
 include/cobalt/uapi/asm-generic/features.h         | 4 ++--
 kernel/cobalt/posix/syscall.c                      | 1 -
 3 files changed, 2 insertions(+), 8 deletions(-)
include/cobalt/kernel/dovetail/pipeline/pipeline.h +0 -5
index 2ee7b32101..18a7da1913 100644
@@ -92,11 +92,6 @@ static inline void pipeline_prepare_panic(void)
 	/* N/A */
 }
 
-static inline void pipeline_collect_features(struct cobalt_featinfo *f)
-{
-	f->clock_freq = 0;	/* N/A */
-}
-
 #ifndef pipeline_get_syscall_args
 static inline void pipeline_get_syscall_args(struct task_struct *task,
 					     struct pt_regs *regs,
include/cobalt/uapi/asm-generic/features.h +2 -2
index 8a4927c491..4f069b1ceb 100644
@@ -23,8 +23,8 @@
 #define XNFEAT_STRING_LEN 64
 
 struct cobalt_featinfo {
-	/** Real-time clock frequency */
-	__u64 clock_freq;
+	/* Used to be real-time clock frequency. */
+	__u64 __reserved1;
 	/** Offset of nkvdso in the sem heap. */
 	__u32 vdso_offset;
 	/** ABI revision level. */
kernel/cobalt/posix/syscall.c +0 -1
index 6193098bab..59c45d0499 100644
@@ -331,7 +331,6 @@ static COBALT_SYSCALL(bind, lostage,
 	f->feat_abirev = XENOMAI_ABI_REV;
 	collect_arch_features(f);
 
-	pipeline_collect_features(f);
 	f->vdso_offset = cobalt_umm_offset(&cobalt_ppd_get(1)->umm, nkvdso);
 
 	if (cobalt_copy_to_user(u_breq, &breq, sizeof(breq)))
Signature · 1 line
2.35.3
author
#15 lore raw

PATCH 13/20 kernel/cobalt: Remove VDSO support

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

No longer used, and userspace no longer expects it with the latest ABI revision.

---
 include/cobalt/kernel/Makefile.am          |   1 -
 include/cobalt/kernel/vdso.h               |  49 ---------
 include/cobalt/sys/cobalt.h                |   1 -
 include/cobalt/uapi/asm-generic/features.h |   4 +-
 include/cobalt/uapi/kernel/Makefile.am     |   4 +-
 include/cobalt/uapi/kernel/urw.h           | 113 ---------------------
 include/cobalt/uapi/kernel/vdso.h          |  66 ------------
 kernel/cobalt/clock.c                      |   2 -
 kernel/cobalt/dovetail/kevents.c           |   1 -
 kernel/cobalt/init.c                       |   1 -
 kernel/cobalt/posix/memory.c               |  21 ----
 kernel/cobalt/posix/process.c              |   1 -
 kernel/cobalt/posix/syscall.c              |   3 -
 13 files changed, 3 insertions(+), 264 deletions(-)
 delete mode 100644 include/cobalt/kernel/vdso.h
 delete mode 100644 include/cobalt/uapi/kernel/urw.h
 delete mode 100644 include/cobalt/uapi/kernel/vdso.h
include/cobalt/kernel/Makefile.am +0 -1
index 6413481f8b..aa6d1de8a5 100644
@@ -31,7 +31,6 @@ noinst_HEADERS =	\
 	timer.h		\
 	trace.h		\
 	tree.h		\
-	vdso.h		\
 	vfile.h
 
 SUBDIRS = rtdm
include/cobalt/kernel/vdso.h deleted +0 -49

49 lines not on this page · raw message

include/cobalt/sys/cobalt.h +0 -1
index 46096e8801..39c9a8493a 100644
@@ -29,7 +29,6 @@
 #include <boilerplate/atomic.h>
 #include <boilerplate/list.h>
 #include <cobalt/uapi/kernel/synch.h>
-#include <cobalt/uapi/kernel/vdso.h>
 #include <cobalt/uapi/corectl.h>
 #include <cobalt/uapi/mutex.h>
 #include <cobalt/uapi/event.h>
include/cobalt/uapi/asm-generic/features.h +2 -2
index 4f069b1ceb..4b0635d0c7 100644
@@ -25,8 +25,8 @@
 struct cobalt_featinfo {
 	/* Used to be real-time clock frequency. */
 	__u64 __reserved1;
-	/** Offset of nkvdso in the sem heap. */
-	__u32 vdso_offset;
+	/* Used to be vdso_offset. */
+	__u32 __reserved2;
 	/** ABI revision level. */
 	__u32 feat_abirev;
 	/** Available feature set. */
include/cobalt/uapi/kernel/Makefile.am +1 -3
index 12e1b37285..093d917bdb 100644
@@ -7,6 +7,4 @@ includesub_HEADERS =	\
 	synch.h		\
 	thread.h	\
 	trace.h		\
-	types.h		\
-	urw.h		\
-	vdso.h
+	types.h
include/cobalt/uapi/kernel/urw.h deleted +0 -113

113 lines not on this page · raw message

include/cobalt/uapi/kernel/vdso.h deleted +0 -66

66 lines not on this page · raw message

kernel/cobalt/clock.c +0 -2
index 2b9efad4e7..fbb7ddbe95 100644
@@ -22,7 +22,6 @@
 #include <cobalt/kernel/timer.h>
 #include <cobalt/kernel/clock.h>
 #include <cobalt/kernel/arith.h>
-#include <cobalt/kernel/vdso.h>
 #include <cobalt/uapi/time.h>
 #include <asm/xenomai/calibration.h>
 #include <trace/events/cobalt-core.h>
@@ -292,7 +291,6 @@ void xnclock_set_wallclock(xnticks_t epoch_ns)
 	old_offset_ns = nkclock.wallclock_offset;
 	offset_ns = (xnsticks_t)(epoch_ns - xnclock_core_read_monotonic());
 	nkclock.wallclock_offset = offset_ns;
-	nkvdso->wallclock_offset = offset_ns;
 	xnclock_apply_offset(&nkclock, offset_ns - old_offset_ns);
 	xnlock_put_irqrestore(&nklock, s);
 }
kernel/cobalt/dovetail/kevents.c +0 -1
index 4da4f51b7a..817aa954dc 100644
@@ -14,7 +14,6 @@
 #include <cobalt/kernel/sched.h>
 #include <cobalt/kernel/thread.h>
 #include <cobalt/kernel/clock.h>
-#include <cobalt/kernel/vdso.h>
 #include <cobalt/kernel/init.h>
 #include <rtdm/driver.h>
 #include <trace/events/cobalt-core.h>
kernel/cobalt/init.c +0 -1
index 5168b56035..509ba3fc4c 100644
@@ -28,7 +28,6 @@
 #include <cobalt/kernel/ppd.h>
 #include <cobalt/kernel/pipe.h>
 #include <cobalt/kernel/select.h>
-#include <cobalt/kernel/vdso.h>
 #include <rtdm/fd.h>
 #include "rtdm/internal.h"
 #include "posix/internal.h"
kernel/cobalt/posix/memory.c +0 -21
index 25cc784ea9..79db01cebd 100644
@@ -23,7 +23,6 @@
 #include <linux/gfp.h>
 #include <linux/vmalloc.h>
 #include <rtdm/driver.h>
-#include <cobalt/kernel/vdso.h>
 #include "process.h"
 #include "memory.h"
 
@@ -31,9 +30,6 @@
 #define UMM_SHARED   1	/* Shared user-mapped memory heap */
 #define SYS_GLOBAL   2	/* System heap (not mmapped) */
 
-struct xnvdso *nkvdso;
-EXPORT_SYMBOL_GPL(nkvdso);
-
 static void umm_vmopen(struct vm_area_struct *vma)
 {
 	struct cobalt_umm *umm = vma->vm_private_data;
@@ -252,12 +248,6 @@ static struct rtdm_device sysmem_device = {
 	.label = COBALT_MEMDEV_SYS,
 };
 
-static inline void init_vdso(void)
-{
-	nkvdso->features = XNVDSO_FEATURES;
-	nkvdso->wallclock_offset = nkclock.wallclock_offset;
-}
-
 int cobalt_memdev_init(void)
 {
 	int ret;
@@ -269,14 +259,6 @@ int cobalt_memdev_init(void)
 
 	cobalt_umm_set_name(&cobalt_kernel_ppd.umm, "shared heap");
 
-	nkvdso = cobalt_umm_alloc(&cobalt_kernel_ppd.umm, sizeof(*nkvdso));
-	if (nkvdso == NULL) {
-		ret = -ENOMEM;
-		goto fail_vdso;
-	}
-
-	init_vdso();
-
 	ret = rtdm_dev_register(umm_devices + UMM_PRIVATE);
 	if (ret)
 		goto fail_private;
@@ -296,8 +278,6 @@ fail_sysmem:
 fail_shared:
 	rtdm_dev_unregister(umm_devices + UMM_PRIVATE);
 fail_private:
-	cobalt_umm_free(&cobalt_kernel_ppd.umm, nkvdso);
-fail_vdso:
 	cobalt_umm_destroy(&cobalt_kernel_ppd.umm);
 
 	return ret;
@@ -308,7 +288,6 @@ void cobalt_memdev_cleanup(void)
 	rtdm_dev_unregister(&sysmem_device);
 	rtdm_dev_unregister(umm_devices + UMM_SHARED);
 	rtdm_dev_unregister(umm_devices + UMM_PRIVATE);
-	cobalt_umm_free(&cobalt_kernel_ppd.umm, nkvdso);
 	cobalt_umm_destroy(&cobalt_kernel_ppd.umm);
 }
 
kernel/cobalt/posix/process.c +0 -1
index 1abc86f37b..23ed913bb2 100644
@@ -44,7 +44,6 @@
 #include <cobalt/kernel/trace.h>
 #include <cobalt/kernel/stat.h>
 #include <cobalt/kernel/ppd.h>
-#include <cobalt/kernel/vdso.h>
 #include <cobalt/kernel/thread.h>
 #include <cobalt/uapi/signal.h>
 #include <cobalt/uapi/syscall.h>
kernel/cobalt/posix/syscall.c +0 -3
index 59c45d0499..66dd1aec85 100644
@@ -23,7 +23,6 @@
 #include <linux/unistd.h>
 #include <cobalt/uapi/corectl.h>
 #include <cobalt/kernel/tree.h>
-#include <cobalt/kernel/vdso.h>
 #include <cobalt/kernel/init.h>
 #include <pipeline/kevents.h>
 #include <pipeline/vdso_fallback.h>
@@ -331,8 +330,6 @@ static COBALT_SYSCALL(bind, lostage,
 	f->feat_abirev = XENOMAI_ABI_REV;
 	collect_arch_features(f);
 
-	f->vdso_offset = cobalt_umm_offset(&cobalt_ppd_get(1)->umm, nkvdso);
-
 	if (cobalt_copy_to_user(u_breq, &breq, sizeof(breq)))
 		return -EFAULT;
 
Signature · 1 line
2.35.3
author
#16 lore raw

PATCH 14/20 testsuite/smokey/rtdm: Remove dead code

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This was left unused behind by e945350051d4.

---
 testsuite/smokey/rtdm/rtdm.c | 12 ------------
 1 file changed, 12 deletions(-)
testsuite/smokey/rtdm/rtdm.c +0 -12
index 6ad0d6d7ad..785132a147 100644
@@ -18,18 +18,6 @@ smokey_test_plugin(rtdm,
 		   "Check core interface to RTDM services."
 );
 
-#define NS_PER_MS (1000000)
-
-static inline unsigned long long timer_get_tsc(void)
-{
-	return clockobj_get_tsc();
-}
-
-static inline unsigned long long timer_tsc2ns(unsigned long long tsc)
-{
-	return clockobj_tsc_to_ns(tsc);
-}
-
 static void check_inner(const char *fn, int line, const char *msg,
 			int status, int expected)
 {
Signature · 1 line
2.35.3
author
#17 lore raw

PATCH 15/20 lib/cobalt: Refactor cobalt_read_tsc API to cobalt_read_ns

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

As we are now only reading nanoseconds via cobalt_read_tsc, change the API to make this clear, obsoleting cobalt_ticks_to_ns, cobalt_ticks_to_ns_rounded and cobalt_ns_to_ticks at the same time.

Existing users are adjusted accordingly.

---
 include/cobalt/sys/cobalt.h    |  2 +-
 include/cobalt/ticks.h         | 18 -----------------
 include/copperplate/clockobj.h | 30 +++++++++------------------
 lib/cobalt/internal.c          |  2 +-
 lib/copperplate/clockobj.c     |  4 ++--
 testsuite/smokey/tsc/tsc.c     | 37 +++++++---------------------------
 6 files changed, 21 insertions(+), 72 deletions(-)
include/cobalt/sys/cobalt.h +1 -1
index 39c9a8493a..ba629cbeba 100644
@@ -133,7 +133,7 @@ void cobalt_register_tsd_hook(struct cobalt_tsd_hook *th);
 
 void cobalt_assert_nrt(void);
 
-unsigned long long cobalt_read_tsc(void);
+unsigned long long cobalt_read_ns(void);
 
 extern int __cobalt_control_bind;
 
include/cobalt/ticks.h +0 -18
index fe5a6ac21a..d9cde6323d 100644
@@ -25,24 +25,6 @@
 extern "C" {
 #endif
 
-static inline
-xnsticks_t cobalt_ns_to_ticks(xnsticks_t ns)
-{
-	return ns;
-}
-
-static inline
-xnsticks_t cobalt_ticks_to_ns(xnsticks_t ticks)
-{
-	return ticks;
-}
-
-static inline
-xnsticks_t cobalt_ticks_to_ns_rounded(xnsticks_t ticks)
-{
-	return ticks;
-}
-
 unsigned long long cobalt_divrem_billion(unsigned long long value,
 					 unsigned long *rem);
 #ifdef __cplusplus
include/copperplate/clockobj.h +10 -20
index dde18bda87..b29c58bdb7 100644
@@ -124,17 +124,7 @@ void __clockobj_ticks_to_timespec(struct clockobj *clkobj,
 static inline ticks_t clockobj_get_tsc(void)
 {
 	/* Guaranteed to be the source of CLOCK_COPPERPLATE. */
-	return cobalt_read_tsc();
-}
-
-static inline sticks_t clockobj_ns_to_tsc(sticks_t ns)
-{
-	return cobalt_ns_to_ticks(ns);
-}
-
-static inline sticks_t clockobj_tsc_to_ns(sticks_t tsc)
-{
-	return cobalt_ticks_to_ns(tsc);
+	return cobalt_read_ns();
 }
 
 static inline
@@ -150,6 +140,15 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
 
 ticks_t clockobj_get_tsc(void);
 
+static inline
+void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
+{
+	ts->tv_sec = ns / 1000000000ULL;
+	ts->tv_nsec = ns - (ts->tv_sec * 1000000000ULL);
+}
+
+#endif /* CONFIG_XENO_MERCURY */
+
 static inline sticks_t clockobj_ns_to_tsc(sticks_t ns)
 {
 	return ns;
@@ -160,15 +159,6 @@ static inline sticks_t clockobj_tsc_to_ns(sticks_t tsc)
 	return tsc;
 }
 
-static inline
-void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
-{
-	ts->tv_sec = ns / 1000000000ULL;
-	ts->tv_nsec = ns - (ts->tv_sec * 1000000000ULL);
-}
-
-#endif /* CONFIG_XENO_MERCURY */
-
 #ifdef CONFIG_XENO_LORES_CLOCK_DISABLED
 
 static inline
lib/cobalt/internal.c +1 -1
index 74b5bd8350..b9f518ed16 100644
@@ -576,7 +576,7 @@ void cobalt_assert_nrt(void)
 		pthread_kill(pthread_self(), SIGDEBUG);
 }
 
-unsigned long long cobalt_read_tsc(void)
+unsigned long long cobalt_read_ns(void)
 {
 	struct timespec ts;
 
lib/copperplate/clockobj.c +2 -2
index b57bb46e7a..a9a8f8a25a 100644
@@ -237,7 +237,7 @@ int clockobj_set_resolution(struct clockobj *clkobj, unsigned int resolution_ns)
 
 ticks_t clockobj_get_time(struct clockobj *clkobj)
 {
-	ticks_t ns = cobalt_ticks_to_ns_rounded(cobalt_read_tsc());
+	ticks_t ns = cobalt_read_ns();
 	return clockobj_ns_to_ticks(clkobj, ns);
 }
 
@@ -257,7 +257,7 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t *pticks)
 
 	read_lock_nocancel(&clkobj->lock);
 
-	ns = cobalt_ticks_to_ns(clockobj_get_tsc());
+	ns = clockobj_get_tsc();
 	/* Add offset to epoch. */
 	ns += (ticks_t)clkobj->offset.tv_sec * 1000000000ULL;
 	ns += clkobj->offset.tv_nsec;
testsuite/smokey/tsc/tsc.c +7 -30
index f9ae82fec3..5cc6749761 100644
@@ -49,30 +49,9 @@ smokey_test_plugin(tsc,
 		"Check that emulated tsc is monotonic"
 );
 
-
-static inline unsigned long long timer_get_tsc(void)
-{
-	/*
-	 * The additional function call clockobj_get_tsc() makes a big
-	 * difference on low end
-	 */
-	return cobalt_read_tsc();
-}
-
-static inline unsigned long long timer_tsc2ns(unsigned long long tsc)
-{
-	return clockobj_tsc_to_ns(tsc);
-}
-
-static inline unsigned long long timer_ns2tsc(unsigned long long ns)
-{
-	return clockobj_ns_to_tsc(ns);
-}
-
 static int run_tsc(struct smokey_test *t, int argc, char *const argv[])
 {
 	unsigned long long runtime, start, jump, tsc1, tsc2;
-	unsigned long long one_sec_tsc;
 	unsigned long long sum, g_sum;
 	unsigned long long loops, g_loops;
 	unsigned dt, min, max, g_min, g_max;
@@ -102,10 +81,8 @@ static int run_tsc(struct smokey_test *t, int argc, char *const argv[])
 
 	smokey_parse_args(t, argc, argv);
 
-	one_sec_tsc = timer_ns2tsc(ONE_BILLION);
-
-	runtime = timer_get_tsc();
-	margin = timer_tsc2ns(2000);
+	runtime = cobalt_read_ns();
+	margin = 2000;
 	if (margin < 80)
 		margin = 80;
 
@@ -123,15 +100,15 @@ static int run_tsc(struct smokey_test *t, int argc, char *const argv[])
 		max = 0;
 		sum = 0;
 		loops = 0;
-		tsc2 = start = timer_get_tsc();
+		tsc2 = start = cobalt_read_ns();
 		do {
-			tsc1 = timer_get_tsc();
+			tsc1 = cobalt_read_ns();
 			if (tsc1 < tsc2) {
 				fprintf(stderr, "%016Lx -> %016Lx\n",
 					tsc2, tsc1);
 				goto err1;
 			}
-			tsc2 = timer_get_tsc();
+			tsc2 = cobalt_read_ns();
 			if (tsc2 < tsc1) {
 				fprintf(stderr, "%016Lx -> %016Lx\n",
 					tsc1, tsc2);
@@ -149,7 +126,7 @@ static int run_tsc(struct smokey_test *t, int argc, char *const argv[])
 				max = dt;
 			sum += dt;
 			++loops;
-		} while (tsc2 - start < one_sec_tsc);
+		} while (tsc2 - start < ONE_BILLION);
 
 		smokey_trace("min: %u, max: %u, avg: %g",
 			min, max, (double)sum / loops);
@@ -164,7 +141,7 @@ static int run_tsc(struct smokey_test *t, int argc, char *const argv[])
 
 	smokey_trace("min: %u, max: %u, avg: %g -> %g us",
 		g_min, g_max, (double)g_sum / g_loops,
-		(double)timer_tsc2ns(g_sum) / (1000 * g_loops));
+		(double)g_sum / (1000 * g_loops));
 
 	return EXIT_SUCCESS;
 
Signature · 1 line
2.35.3
author
#3 lore raw

PATCH 3/20 cobalt: Drop not longer supported CONFIG_XENO_OPT_STATS_IRQS

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This was I-pipe-only, and I-pipe is gone.

---
 include/cobalt/kernel/intr.h | 30 ---------------------
 kernel/cobalt/Kconfig        | 12 ---------
 kernel/cobalt/sched.c        | 51 ++----------------------------------
 3 files changed, 2 insertions(+), 91 deletions(-)
include/cobalt/kernel/intr.h +0 -30
index 393ad96830..060edc8a57 100644
@@ -84,10 +84,6 @@ struct xnintr {
 	const char *name;
 	/** Descriptor maintenance lock. */
 	raw_spinlock_t lock;
-#ifdef CONFIG_XENO_OPT_STATS_IRQS
-	/** Statistics. */
-	struct xnirqstat *stats;
-#endif
 };
 
 struct xnintr_iterator {
@@ -126,32 +122,6 @@ void xnintr_disable(struct xnintr *intr);
 
 int xnintr_affinity(struct xnintr *intr, const cpumask_t *cpumask);
 
-#ifdef CONFIG_XENO_OPT_STATS_IRQS
-
-int xnintr_query_init(struct xnintr_iterator *iterator);
-
-int xnintr_get_query_lock(void);
-
-void xnintr_put_query_lock(void);
-
-int xnintr_query_next(int irq, struct xnintr_iterator *iterator,
-		      char *name_buf);
-
-#else /* !CONFIG_XENO_OPT_STATS_IRQS */
-
-static inline int xnintr_query_init(struct xnintr_iterator *iterator)
-{
-	return 0;
-}
-
-static inline int xnintr_get_query_lock(void)
-{
-	return 0;
-}
-
-static inline void xnintr_put_query_lock(void) {}
-#endif /* !CONFIG_XENO_OPT_STATS_IRQS */
-
 /** @} */
 
 #endif /* !_COBALT_KERNEL_INTR_H */
kernel/cobalt/Kconfig +0 -12
index 3233de1b18..6ba4cdc5db 100644
@@ -135,18 +135,6 @@ config XENO_OPT_STATS
 	per-thread runtime statistics, which are accessible through
 	the /proc/xenomai/sched/stat interface.
 
-config XENO_OPT_STATS_IRQS
-	bool "Account IRQ handlers separatly"
-	depends on XENO_OPT_STATS && IPIPE
-	default y
-	help
-	When enabled, the runtime of interrupt handlers is accounted
-	separately from the threads they interrupt. Also, the
-	occurrence of shared interrupts is accounted on a per-handler
-	basis.
-
-	This option is available to legacy I-pipe builds only.
-
 config XENO_OPT_SHIRQ
 	bool "Shared interrupts"
 	help
kernel/cobalt/sched.c +2 -49

88 lines not on this page · raw message

Signature · 1 line
2.35.3
author
#4 lore raw

PATCH 4/20 testsuite/smokey/y2038: Activate minimal clock_settime64

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

The clock_settime64 syscall is theoretically still relevant, even with libc-based settime for standard clocks, but only for external clocks - which we do not have in-tree. But we can at least check that invalid parameters are detected and rejected

---
 testsuite/smokey/y2038/syscall-tests.c | 30 --------------------------
 1 file changed, 30 deletions(-)
testsuite/smokey/y2038/syscall-tests.c +0 -30
index 0c7de52161..3d4a9106bd 100644
@@ -278,18 +278,9 @@ static int test_sc_cobalt_clock_settime64(void)
 {
 	int ret;
 	int sc_nr = sc_cobalt_clock_settime64;
-	struct xn_timespec64 ts64, now64;
-	struct timespec now;
-
-	if (!cobalt_use_legacy_tsc())
-		return 0; // Not implemented, nothing to test, success
 
 	/* Make sure we don't crash because of NULL pointers */
 	ret = XENOMAI_SYSCALL2(sc_nr, NULL, NULL);
-	if (ret == -ENOSYS) {
-		smokey_note("clock_settime64: skipped. (no kernel support)");
-		return 0; // Not implemented, nothing to test, success
-	}
 	if (!smokey_assert(ret == -EFAULT))
 		return ret ? ret : -EINVAL;
 
@@ -298,27 +289,6 @@ static int test_sc_cobalt_clock_settime64(void)
 	if (!smokey_assert(ret == -EFAULT))
 		return ret ? ret : -EINVAL;
 
-	ret = clock_gettime(CLOCK_REALTIME, &now);
-	if (ret)
-		return -errno;
-
-	/* Provide a valid 64bit timespec */
-	ts64.tv_sec  = now.tv_sec + 1;
-	ts64.tv_nsec = now.tv_nsec;
-	ret = XENOMAI_SYSCALL2(sc_nr, CLOCK_REALTIME, &ts64);
-	if (!smokey_assert(!ret))
-		return ret;
-
-	ret = clock_gettime(CLOCK_REALTIME, &now);
-	if (ret)
-		return -errno;
-
-	now64.tv_sec = now.tv_sec;
-	now64.tv_nsec = now.tv_nsec;
-
-	if (ts_less(&now64, &ts64))
-		smokey_warning("clock_settime() reported no error but no new time seen");
-
 	return 0;
 }
 
Signature · 1 line
2.35.3
author
#13 lore raw

PATCH 11/20 kernel/cobalt: Remove archcall syscall stub

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This was returning ENOSYS only anyway.

---
 include/cobalt/uapi/syscall.h                          | 2 +-
 kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h   | 9 ---------
 kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h | 9 ---------
 kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h   | 8 --------
 kernel/cobalt/posix/syscall.c                          | 8 --------
 kernel/cobalt/trace/cobalt-posix.h                     | 1 -
 6 files changed, 1 insertion(+), 36 deletions(-)
include/cobalt/uapi/syscall.h +1 -1
index 3e65efaabe..f27988f552 100644
@@ -109,7 +109,7 @@
 #define sc_cobalt_select			86
 #define sc_cobalt_fcntl				87
 #define sc_cobalt_migrate			88
-#define sc_cobalt_archcall			89
+/* 89: formerly archcall */
 #define sc_cobalt_trace				90
 #define sc_cobalt_corectl			91
 #define sc_cobalt_get_current			92
kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h +0 -9
index 2490e7fe81..1721977251 100644
@@ -77,15 +77,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 	return __xn_reg_rval(regs) == -EINTR;
 }
 
-static inline
-int xnarch_local_syscall(unsigned long a1, unsigned long a2,
-			unsigned long a3, unsigned long a4,
-			unsigned long a5)
-{
-	/* We need none of these with Dovetail. */
-	return -ENOSYS;
-}
-
 #define pipeline_get_syscall_args pipeline_get_syscall_args
 static inline void pipeline_get_syscall_args(struct task_struct *task,
 					     struct pt_regs *regs,
kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h +0 -9
index 0f1d1eaf8d..26e4ed8c32 100644
@@ -51,13 +51,4 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 	return __xn_reg_rval(regs) == -EINTR;
 }
 
-static inline
-int xnarch_local_syscall(unsigned long a1, unsigned long a2,
-			unsigned long a3, unsigned long a4,
-			unsigned long a5)
-{
-	/* We need none of these with Dovetail. */
-	return -ENOSYS;
-}
-
 #endif /* !_COBALT_ARM64_SYSCALL_H */
kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h +0 -8
index b2e158247f..f60aed0132 100644
@@ -74,12 +74,4 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 	return __xn_reg_rval(regs) == -EINTR;
 }
 
-static inline
-int xnarch_local_syscall(unsigned long a1, unsigned long a2,
-			 unsigned long a3, unsigned long a4,
-			 unsigned long a5)
-{
-	return -ENOSYS;
-}
-
 #endif /* !_COBALT_X86_ASM_SYSCALL_H */
kernel/cobalt/posix/syscall.c +0 -8
index 46c4998e4c..6193098bab 100644
@@ -205,14 +205,6 @@ static COBALT_SYSCALL(ftrace_puts, current,
 	return 0;
 }
 
-static COBALT_SYSCALL(archcall, current,
-		      (unsigned long a1, unsigned long a2,
-		       unsigned long a3, unsigned long a4,
-		       unsigned long a5))
-{
-	return xnarch_local_syscall(a1, a2, a3, a4, a5);
-}
-
 static COBALT_SYSCALL(get_current, current,
 		      (xnhandle_t __user *u_handle))
 {
kernel/cobalt/trace/cobalt-posix.h +0 -1
index 47dc77e1cd..1c93023240 100644
@@ -144,7 +144,6 @@
 		__cobalt_symbolic_syscall(select),			\
 		__cobalt_symbolic_syscall(fcntl),			\
 		__cobalt_symbolic_syscall(migrate),			\
-		__cobalt_symbolic_syscall(archcall),			\
 		__cobalt_symbolic_syscall(trace),			\
 		__cobalt_symbolic_syscall(corectl),			\
 		__cobalt_symbolic_syscall(get_current),			\
Signature · 1 line
2.35.3
author
#18 lore raw

PATCH 16/20 lib/copperplate: Refactor clockobj_get_tsc API to clockobj_get_ns

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

As we are now only reading nanoseconds via clockobj_get_tsc, change the API to make this clear, obsoleting clockobj_tsc_to_ns and clockobj_ns_to_tsc at the same time.

Existing users are adjusted accordingly.

---
 include/copperplate/clockobj.h           | 23 ++++--------
 lib/copperplate/clockobj.c               |  6 ++--
 lib/copperplate/threadobj.c              |  4 +--
 lib/psos/tm.c                            |  2 +-
 testsuite/smokey/arith/arith.c           |  6 ++--
 testsuite/smokey/posix-cond/posix-cond.c | 46 ++++++++++--------------
 6 files changed, 33 insertions(+), 54 deletions(-)
include/copperplate/clockobj.h +6 -17
index b29c58bdb7..c06737e115 100644
@@ -114,14 +114,13 @@ void __clockobj_ticks_to_timespec(struct clockobj *clkobj,
 
 /*
  * The Cobalt core exclusively deals with aperiodic timings, so a
- * Cobalt _tick_ is actually a _TSC_ unit. In contrast, Copperplate
- * deals with _TSC_ units and periodic _ticks_ which duration depend
- * on the clock resolution. Therefore, Cobalt ticks are strictly
- * equivalent to Copperplate TSC units, and Copperplate ticks are
- * periods of the reference clockobj which Cobalt does not know about.
+ * Cobalt _tick_ is actually a nanosecond unit. In contrast, Copperplate
+ * deals with both nanosecond units and periodic _ticks_ which duration
+ * depend on the clock resolution. Copperplate ticks are periods of the
+ * reference clockobj which Cobalt does not know about.
  */
 
-static inline ticks_t clockobj_get_tsc(void)
+static inline ticks_t clockobj_get_ns(void)
 {
 	/* Guaranteed to be the source of CLOCK_COPPERPLATE. */
 	return cobalt_read_ns();
@@ -138,7 +137,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
 
 #else /* CONFIG_XENO_MERCURY */
 
-ticks_t clockobj_get_tsc(void);
+ticks_t clockobj_get_ns(void);
 
 static inline
 void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
@@ -149,16 +148,6 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
 
 #endif /* CONFIG_XENO_MERCURY */
 
-static inline sticks_t clockobj_ns_to_tsc(sticks_t ns)
-{
-	return ns;
-}
-
-static inline sticks_t clockobj_tsc_to_ns(sticks_t tsc)
-{
-	return tsc;
-}
-
 #ifdef CONFIG_XENO_LORES_CLOCK_DISABLED
 
 static inline
lib/copperplate/clockobj.c +3 -3
index a9a8f8a25a..3a771e474b 100644
@@ -257,7 +257,7 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t *pticks)
 
 	read_lock_nocancel(&clkobj->lock);
 
-	ns = clockobj_get_tsc();
+	ns = clockobj_get_ns();
 	/* Add offset to epoch. */
 	ns += (ticks_t)clkobj->offset.tv_sec * 1000000000ULL;
 	ns += clkobj->offset.tv_nsec;
@@ -270,7 +270,7 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t *pticks)
 
 #else /* CONFIG_XENO_MERCURY */
 
-ticks_t clockobj_get_tsc(void)
+ticks_t clockobj_get_ns(void)
 {
 	struct timespec now;
 	clock_gettime(CLOCK_COPPERPLATE, &now);
@@ -279,7 +279,7 @@ ticks_t clockobj_get_tsc(void)
 
 ticks_t clockobj_get_time(struct clockobj *clkobj)
 {
-	ticks_t ns = clockobj_get_tsc();
+	ticks_t ns = clockobj_get_ns();
 
 	if (clockobj_get_resolution(clkobj) > 1)
 		return ns / clockobj_get_resolution(clkobj);
lib/copperplate/threadobj.c +2 -2
index db18f4ffa3..b97807c8a7 100644
@@ -1693,8 +1693,8 @@ void threadobj_spin(ticks_t ns)
 {
 	ticks_t end;
 
-	end = clockobj_get_tsc() + clockobj_ns_to_tsc(ns);
-	while (clockobj_get_tsc() < end)
+	end = clockobj_get_ns() + ns;
+	while (clockobj_get_ns() < end)
 		cpu_relax();
 }
 
lib/psos/tm.c +1 -1
index c315335236..de7d56d1ed 100644
@@ -347,6 +347,6 @@ u_long tm_get(u_long *date_r, u_long *time_r, u_long *ticks_r)
 
 u_long tm_getm(unsigned long long *ns_r)
 {
-	*ns_r = clockobj_tsc_to_ns(clockobj_get_tsc());
+	*ns_r = clockobj_get_ns();
 	return SUCCESS;
 }
testsuite/smokey/arith/arith.c +3 -3
index c927d1d122..edb87229a0 100644
@@ -20,9 +20,9 @@ static volatile long long arg = 0x3ffffffffffffffULL;
 		  	ticks_t start, end;				\
 			unsigned long delta;				\
 									\
-			start = clockobj_get_tsc();			\
+			start = clockobj_get_ns();			\
 			result = (f);					\
-			end = clockobj_get_tsc();			\
+			end = clockobj_get_ns();			\
 			delta = end - start;				\
 									\
 			if (i == 0 || delta < (avg / i) * 4) {		\
@@ -32,7 +32,7 @@ static volatile long long arg = 0x3ffffffffffffffULL;
 		}							\
 		if (rejected < 10000) {					\
 			avg = xnarch_llimd(avg, 10000, 10000 - rejected); \
-			avg = clockobj_tsc_to_ns(avg) - calib;		\
+			avg -= calib;		\
 			smokey_trace("%s: 0x%016llx: %lld.%03llu ns,"	\
 				    " rejected %d/10000",		\
 				    display, result, avg / 10000,	\
testsuite/smokey/posix-cond/posix-cond.c +18 -28

160 lines not on this page · raw message

Signature · 1 line
2.35.3
author
#22 lore raw

PATCH 18/20 include/cobalt: Fix inclusion guard names

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

Copy&pasted from their former I-pipe sibling.

---
 include/cobalt/kernel/dovetail/pipeline/tick.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/cobalt/kernel/dovetail/pipeline/tick.h +3 -3
index 372d8323fc..2670a7d339 100644
@@ -2,8 +2,8 @@
  * SPDX-License-Identifier: GPL-2.0
  */
 
-#ifndef _COBALT_KERNEL_IPIPE_TICK_H
-#define _COBALT_KERNEL_IPIPE_TICK_H
+#ifndef _COBALT_KERNEL_DOVETAIL_TICK_H
+#define _COBALT_KERNEL_DOVETAIL_TICK_H
 
 int pipeline_install_tick_proxy(void);
 
@@ -13,4 +13,4 @@ struct xnsched;
 
 bool pipeline_must_force_program_tick(struct xnsched *sched);
 
-#endif /* !_COBALT_KERNEL_IPIPE_TICK_H */
+#endif /* !_COBALT_KERNEL_DOVETAIL_TICK_H */
Signature · 1 line
2.35.3
author
#23 lore raw

PATCH 19/20 ci: Update comment

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.yml +1 -1
index 5c8e01f098..8c1cfa2dc9 100644
@@ -73,7 +73,7 @@ variables:
     - make -j $(nproc) ${KERNEL_DEFCONFIG}
     # Generic settings
     - ./scripts/config -d DEBUG_INFO
-    # I-pipe and Xenomai settings
+    # Dovetail and Xenomai settings
     - ./scripts/config -e DOVETAIL
     - ./scripts/config -e XENOMAI
     - ./scripts/config -e XENO_OPT_SCHED_CLASSES
Signature · 1 line
2.35.3
author
#24 lore raw

PATCH 20/20 cobalt/posix: Update comment

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

---
 kernel/cobalt/posix/process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cobalt/posix/process.c +2 -2
index 23ed913bb2..7cfaa723e6 100644
@@ -638,8 +638,8 @@ int cobalt_map_user(struct xnthread *thread, __u32 __user *u_winoff)
 	 * ->map_thread() handler is invoked after the TCB is fully
 	 * built, and when we know for sure that current will go
 	 * through our task-exit handler, because it has a shadow
-	 * extension and I-pipe notifications will soon be enabled for
-	 * it.
+	 * extension and dovetail notifications will soon be enabled
+	 * for it.
 	 */
 	xnthread_run_handler(thread, map_thread);
 	pipeline_enable_kevents();
Signature · 1 line
2.35.3
author
#19 lore raw

PATCH 17/20 scripts/Kconfig.frag: Switch to I-pipe only

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

---
 scripts/Kconfig.frag | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
scripts/Kconfig.frag +2 -4
index 7921286638..b76d25e535 100644
@@ -1,10 +1,8 @@
 menuconfig XENOMAI
 	depends on X86_TSC || !X86
 	bool "Xenomai/cobalt"
-	select IPIPE if HAVE_IPIPE_SUPPORT
-	select IPIPE_WANT_APIREV_2 if IPIPE
-	select DOVETAIL if HAVE_DOVETAIL
-	select DOVETAIL_LEGACY_SYSCALL_RANGE if HAVE_DOVETAIL
+	select DOVETAIL
+	select DOVETAIL_LEGACY_SYSCALL_RANGE
 	default y
 	help
 	  Xenomai's Cobalt core is a real-time extension to the Linux
Signature · 1 line
2.35.3
#5 lore raw

Re: [PATCH 04/20] testsuite/smokey/y2038: Activate minimal clock_settime64

In reply to Jan Kiszka
Quoted 22 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

The clock_settime64 syscall is theoretically still relevant, even with libc-based settime for standard clocks, but only for external clocks - which we do not have in-tree. But we can at least check that invalid parameters are detected and rejected

---
 testsuite/smokey/y2038/syscall-tests.c | 30 --------------------------
 1 file changed, 30 deletions(-)
testsuite/smokey/y2038/syscall-tests.c +0 -2
index 0c7de52161..3d4a9106bd 100644
@@ -278,18 +278,9 @@ static int test_sc_cobalt_clock_settime64(void)
 {
 	int ret;
 	int sc_nr = sc_cobalt_clock_settime64;
-	struct xn_timespec64 ts64, now64;
-	struct timespec now;

testsuite/smokey/y2038/syscall-tests.c static int test_sc_cobalt_clock_settime64(void) · line 292

Quoted 10 lines
testsuite/smokey/y2038/syscall-tests.c +0 -7
-
-	if (!cobalt_use_legacy_tsc())
-		return 0; // Not implemented, nothing to test, success
 
 	/* Make sure we don't crash because of NULL pointers */
 	ret = XENOMAI_SYSCALL2(sc_nr, NULL, NULL);
-	if (ret == -ENOSYS) {
-		smokey_note("clock_settime64: skipped. (no kernel support)");
-		return 0; // Not implemented, nothing to test, success
-	}

We could keep that. In case someone is running the testsuite against a kernel not providing the syscall under test. Unlikely but possible.

Quoted 34 lines
testsuite/smokey/y2038/syscall-tests.c +0 -21
 	if (!smokey_assert(ret == -EFAULT))
 		return ret ? ret : -EINVAL;
 
@@ -298,27 +289,6 @@ static int test_sc_cobalt_clock_settime64(void)
 	if (!smokey_assert(ret == -EFAULT))
 		return ret ? ret : -EINVAL;
 
-	ret = clock_gettime(CLOCK_REALTIME, &now);
-	if (ret)
-		return -errno;
-
-	/* Provide a valid 64bit timespec */
-	ts64.tv_sec  = now.tv_sec + 1;
-	ts64.tv_nsec = now.tv_nsec;
-	ret = XENOMAI_SYSCALL2(sc_nr, CLOCK_REALTIME, &ts64);
-	if (!smokey_assert(!ret))
-		return ret;
-
-	ret = clock_gettime(CLOCK_REALTIME, &now);
-	if (ret)
-		return -errno;
-
-	now64.tv_sec = now.tv_sec;
-	now64.tv_nsec = now.tv_nsec;
-
-	if (ts_less(&now64, &ts64))
-		smokey_warning("clock_settime() reported no error but no new time seen");
-
 	return 0;
 }
 
Signature · 1 line
2.35.3
#20 lore raw

Re: [PATCH 17/20] scripts/Kconfig.frag: Switch to I-pipe only

In reply to Jan Kiszka
Quoted 1 line · Jan Kiszka

From: Jan Kiszka <[email protected]>

I think the subject is wrong. It's dovetail only.

Quoted 26 lines
---
 scripts/Kconfig.frag | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
scripts/Kconfig.frag +2 -4
index 7921286638..b76d25e535 100644
@@ -1,10 +1,8 @@
 menuconfig XENOMAI
 	depends on X86_TSC || !X86
 	bool "Xenomai/cobalt"
-	select IPIPE if HAVE_IPIPE_SUPPORT
-	select IPIPE_WANT_APIREV_2 if IPIPE
-	select DOVETAIL if HAVE_DOVETAIL
-	select DOVETAIL_LEGACY_SYSCALL_RANGE if HAVE_DOVETAIL
+	select DOVETAIL
+	select DOVETAIL_LEGACY_SYSCALL_RANGE
 	default y
 	help
 	  Xenomai's Cobalt core is a real-time extension to the Linux
Signature · 1 line
2.35.3
author
#6 lore raw

Re: [PATCH 04/20] testsuite/smokey/y2038: Activate minimal clock_settime64

In reply to Florian Bezdeka
Quoted 27 lines · Florian Bezdeka
Quoted 26 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

The clock_settime64 syscall is theoretically still relevant, even with libc-based settime for standard clocks, but only for external clocks - which we do not have in-tree. But we can at least check that invalid parameters are detected and rejected

---
 testsuite/smokey/y2038/syscall-tests.c | 30 --------------------------
 1 file changed, 30 deletions(-)
testsuite/smokey/y2038/syscall-tests.c +0 -5
index 0c7de52161..3d4a9106bd 100644
@@ -278,18 +278,9 @@ static int test_sc_cobalt_clock_settime64(void)
 {
 	int ret;
 	int sc_nr = sc_cobalt_clock_settime64;
-	struct xn_timespec64 ts64, now64;
-	struct timespec now;
-
-	if (!cobalt_use_legacy_tsc())
-		return 0; // Not implemented, nothing to test, success
 
Quoted 9 lines

testsuite/smokey/y2038/syscall-tests.c static int test_sc_cobalt_clock_settime64(void) · line 292

Quoted 6 lines
testsuite/smokey/y2038/syscall-tests.c +0 -4
 	/* Make sure we don't crash because of NULL pointers */
 	ret = XENOMAI_SYSCALL2(sc_nr, NULL, NULL);
-	if (ret == -ENOSYS) {
-		smokey_note("clock_settime64: skipped. (no kernel support)");
-		return 0; // Not implemented, nothing to test, success
-	}

We could keep that. In case someone is running the testsuite against a kernel not providing the syscall under test. Unlikely but possible.

Not possible anymore due to ABI revision bump (and all the changes later in this series as well).

Jan

Quoted 36 lines
Quoted 35 lines
testsuite/smokey/y2038/syscall-tests.c +0 -21
 	if (!smokey_assert(ret == -EFAULT))
 		return ret ? ret : -EINVAL;
 
@@ -298,27 +289,6 @@ static int test_sc_cobalt_clock_settime64(void)
 	if (!smokey_assert(ret == -EFAULT))
 		return ret ? ret : -EINVAL;
 
-	ret = clock_gettime(CLOCK_REALTIME, &now);
-	if (ret)
-		return -errno;
-
-	/* Provide a valid 64bit timespec */
-	ts64.tv_sec  = now.tv_sec + 1;
-	ts64.tv_nsec = now.tv_nsec;
-	ret = XENOMAI_SYSCALL2(sc_nr, CLOCK_REALTIME, &ts64);
-	if (!smokey_assert(!ret))
-		return ret;
-
-	ret = clock_gettime(CLOCK_REALTIME, &now);
-	if (ret)
-		return -errno;
-
-	now64.tv_sec = now.tv_sec;
-	now64.tv_nsec = now.tv_nsec;
-
-	if (ts_less(&now64, &ts64))
-		smokey_warning("clock_settime() reported no error but no new time seen");
-
 	return 0;
 }
 
Signature · 1 line
2.35.3
Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
author
#21 lore raw

Re: [PATCH 17/20] scripts/Kconfig.frag: Switch to I-pipe only

In reply to Florian Bezdeka
Quoted 5 lines · Florian Bezdeka
Quoted 1 line · Jan Kiszka

From: Jan Kiszka <[email protected]>

I think the subject is wrong. It's dovetail only.

Indeed.

Thanks,
Jan

Quoted 27 lines
Quoted 26 lines
---
 scripts/Kconfig.frag | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
scripts/Kconfig.frag +2 -4
index 7921286638..b76d25e535 100644
@@ -1,10 +1,8 @@
 menuconfig XENOMAI
 	depends on X86_TSC || !X86
 	bool "Xenomai/cobalt"
-	select IPIPE if HAVE_IPIPE_SUPPORT
-	select IPIPE_WANT_APIREV_2 if IPIPE
-	select DOVETAIL if HAVE_DOVETAIL
-	select DOVETAIL_LEGACY_SYSCALL_RANGE if HAVE_DOVETAIL
+	select DOVETAIL
+	select DOVETAIL_LEGACY_SYSCALL_RANGE
 	default y
 	help
 	  Xenomai's Cobalt core is a real-time extension to the Linux
Signature · 1 line
2.35.3
Signature · 2 lines
Siemens AG, Technology
Linux Expert Center