Skip to contentSkip to conversation

trinity: Add support for runtime_instr svc

PATCH New Thomas Richter 1 participant 4 messages Feb 13, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 trinity: Add support for runtime_instr svc

This patch adds support for the s390 specific system call runtime_instr() for 31 and 64 bit.

---
 Makefile                       |  1 +
 include/syscalls-s390.h        |  2 +-
 include/syscalls-s390x.h       |  2 +-
 syscalls/s390x/runtime_instr.c | 25 +++++++++++++++++++++++++
 syscalls/syscalls.h            |  1 +
 5 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 syscalls/s390x/runtime_instr.c
Makefile +1 -0
index 78619064..93e3460d 100644
@@ -87,6 +87,7 @@ SYSCALLS_ARCH	:= $(shell case "$(MACHINE)" in \
 				  syscalls/x86/x86_64/*.c;; \
 		   (i?86*) echo syscalls/x86/*.c \
 				syscalls/x86/i386/*.c;; \
+		   (s390x*) echo syscalls/s390x/*.c ;; \
 		   esac)
 
 VERSION_H	:= include/version.h
include/syscalls-s390.h +1 -1
index 682d2030..c02ced94 100644
@@ -349,7 +349,7 @@ struct syscalltable syscalls_s390[] = {
 	{ .entry = &syscall_setns },
 	{ .entry = &syscall_process_vm_readv },
 	{ .entry = &syscall_process_vm_writev },
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_runtime_instr */
+	{ .entry = &syscall_runtime_instr },	/* s390_runtime_instr svc */
 	{ .entry = &syscall_kcmp },
 	{ .entry = &syscall_finit_module },
 	{ .entry = &syscall_sched_setattr },
include/syscalls-s390x.h +1 -1
index a3e26181..b955ceaa 100644
@@ -349,7 +349,7 @@ struct syscalltable syscalls_s390x[] = {
 	{ .entry = &syscall_setns },
 	{ .entry = &syscall_process_vm_readv },
 	{ .entry = &syscall_process_vm_writev },
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_runtime_instr */
+	{ .entry = &syscall_runtime_instr },	/* s390_runtime_instr svc */
 	{ .entry = &syscall_kcmp },
 	{ .entry = &syscall_finit_module },
 	{ .entry = &syscall_sched_setattr },
syscalls/s390x/runtime_instr.c new file +25 -0
new file mode 100644
index 00000000..aa1f75fb
@@ -0,0 +1,25 @@
+/*
+ * int runtime_instr(int on_off, int sig_nr)
+ */
+
+#include "sanitise.h"
+
+#define S390_RUNTIME_INSTR_START	0x1
+#define S390_RUNTIME_INSTR_STOP		0x2
+
+static unsigned long syscall_runtime_instr_arg1[] = {
+	0, S390_RUNTIME_INSTR_START, S390_RUNTIME_INSTR_STOP, 3
+};
+
+struct syscallentry syscall_runtime_instr = {
+	.name = "runtime_instr",
+	.num_args = 2,
+	.arg1name = "on_off",
+	.arg1type = ARG_LIST,
+	.arg1list = ARGLIST(syscall_runtime_instr_arg1),
+	.arg2name = "sig_nr",
+	.arg2type = ARG_RANGE,
+	.low2range = 0,
+	.hi2range = 128,
+	.rettype = RET_ZERO_SUCCESS
+};
syscalls/syscalls.h +1 -0
index 38819b37..2260bbf8 100644
@@ -386,5 +386,6 @@ extern struct syscallentry syscall_pkey_mprotect;
 extern struct syscallentry syscall_pkey_alloc;
 extern struct syscallentry syscall_pkey_free;
 extern struct syscallentry syscall_statx;
+extern struct syscallentry syscall_runtime_instr;
 
 unsigned int random_fcntl_setfl_flags(void);
Signature · 1 line
2.14.3
#1 lore raw

PATCH 2/4 trinity: Add support for s390_pci_mmio_read and write

Add support for s390 specific system calls
s390_pci_mmio_read and 390_pci_mmio_write
for 31 bit and 64 bit.

---
 include/syscalls-s390.h        |  4 +--
 include/syscalls-s390x.h       |  4 +--
 syscalls/s390x/s390_pci_mmio.c | 70 ++++++++++++++++++++++++++++++++++++++++++
 syscalls/syscalls.h            |  2 ++
 4 files changed, 76 insertions(+), 4 deletions(-)
 create mode 100644 syscalls/s390x/s390_pci_mmio.c
include/syscalls-s390.h +2 -2
index c02ced94..a5a30c9e 100644
@@ -363,8 +363,8 @@ struct syscalltable syscalls_s390[] = {
 #else
 	{ .entry = NULL },
 #endif
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_pci_mmio_write svc */
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_pci_mmio_read svc */
+	{ .entry = &syscall_s390_pci_mmio_write },
+	{ .entry = &syscall_s390_pci_mmio_read },
 	{ .entry = &syscall_execveat },
 	{ .entry = &syscall_userfaultfd },
 	{ .entry = &syscall_membarrier },
include/syscalls-s390x.h +2 -2
index b955ceaa..e74caa14 100644
@@ -363,8 +363,8 @@ struct syscalltable syscalls_s390x[] = {
 #else
 	{ .entry = NULL },
 #endif
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_pci_mmio_write svc */
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_pci_mmio_read svc */
+	{ .entry = &syscall_s390_pci_mmio_write },
+	{ .entry = &syscall_s390_pci_mmio_read },
 	{ .entry = &syscall_execveat },
 	{ .entry = &syscall_userfaultfd },
 	{ .entry = &syscall_membarrier },
syscalls/s390x/s390_pci_mmio.c new file +70 -0

70 lines not on this page · raw message

syscalls/syscalls.h +2 -0
index 2260bbf8..6564e22e 100644
@@ -387,5 +387,7 @@ extern struct syscallentry syscall_pkey_alloc;
 extern struct syscallentry syscall_pkey_free;
 extern struct syscallentry syscall_statx;
 extern struct syscallentry syscall_runtime_instr;
+extern struct syscallentry syscall_s390_pci_mmio_write;
+extern struct syscallentry syscall_s390_pci_mmio_read;
 
 unsigned int random_fcntl_setfl_flags(void);
Signature · 1 line
2.14.3
#2 lore raw

PATCH 3/4 trinity: Add support for s390_guarded_storage svc

In reply to Thomas Richter

Add support for s390 specific system call s390_guarded_storage for 31 bit and 64 bit.

---
 include/syscalls-s390.h               |  2 +-
 include/syscalls-s390x.h              |  2 +-
 syscalls/s390x/s390_guarded_storage.c | 48 +++++++++++++++++++++++++++++++++++
 syscalls/syscalls.h                   |  1 +
 4 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 syscalls/s390x/s390_guarded_storage.c
include/syscalls-s390.h +1 -1
index a5a30c9e..ad2f88c6 100644
@@ -389,7 +389,7 @@ struct syscalltable syscalls_s390[] = {
 	{ .entry = &syscall_copy_file_range },
 	{ .entry = &syscall_preadv2 },
 	{ .entry = &syscall_pwritev2 },
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_guarded_storage svc */
+	{ .entry = &syscall_s390_guarded_storage },
 	{ .entry = &syscall_statx },
 	{ .entry = &syscall_ni_syscall },	/* TODO: s390_sthyi svc */
 };
include/syscalls-s390x.h +1 -1
index e74caa14..a83974e4 100644
@@ -389,7 +389,7 @@ struct syscalltable syscalls_s390x[] = {
 	{ .entry = &syscall_copy_file_range },
 	{ .entry = &syscall_preadv2 },
 	{ .entry = &syscall_pwritev2 },
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_guarded_storage svc */
+	{ .entry = &syscall_s390_guarded_storage },
 	{ .entry = &syscall_statx },
 	{ .entry = &syscall_ni_syscall },	/* TODO: s390_sthyi svc */
 };
syscalls/s390x/s390_guarded_storage.c new file +48 -0

48 lines not on this page · raw message

syscalls/syscalls.h +1 -0
index 6564e22e..38271170 100644
@@ -389,5 +389,6 @@ extern struct syscallentry syscall_statx;
 extern struct syscallentry syscall_runtime_instr;
 extern struct syscallentry syscall_s390_pci_mmio_write;
 extern struct syscallentry syscall_s390_pci_mmio_read;
+extern struct syscallentry syscall_s390_guarded_storage;
 
 unsigned int random_fcntl_setfl_flags(void);
Signature · 1 line
2.14.3
#3 lore raw

PATCH 4/4 trinity: Add support for s390_sthyi svc

In reply to Thomas Richter

Add support for s390 specific system call s390_sthyi for 31 bit and 64 bit.

---
 include/syscalls-s390.h     |  2 +-
 include/syscalls-s390x.h    |  2 +-
 syscalls/s390x/s390_sthyi.c | 60 +++++++++++++++++++++++++++++++++++++++++++++
 syscalls/syscalls.h         |  1 +
 4 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 syscalls/s390x/s390_sthyi.c
include/syscalls-s390.h +1 -1
index ad2f88c6..07706650 100644
@@ -391,5 +391,5 @@ struct syscalltable syscalls_s390[] = {
 	{ .entry = &syscall_pwritev2 },
 	{ .entry = &syscall_s390_guarded_storage },
 	{ .entry = &syscall_statx },
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_sthyi svc */
+	{ .entry = &syscall_s390_sthyi },
 };
include/syscalls-s390x.h +1 -1
index a83974e4..66f3bc56 100644
@@ -391,5 +391,5 @@ struct syscalltable syscalls_s390x[] = {
 	{ .entry = &syscall_pwritev2 },
 	{ .entry = &syscall_s390_guarded_storage },
 	{ .entry = &syscall_statx },
-	{ .entry = &syscall_ni_syscall },	/* TODO: s390_sthyi svc */
+	{ .entry = &syscall_s390_sthyi },
 };
syscalls/s390x/s390_sthyi.c new file +60 -0

60 lines not on this page · raw message

syscalls/syscalls.h +1 -0
index 38271170..3620c4ea 100644
@@ -390,5 +390,6 @@ extern struct syscallentry syscall_runtime_instr;
 extern struct syscallentry syscall_s390_pci_mmio_write;
 extern struct syscallentry syscall_s390_pci_mmio_read;
 extern struct syscallentry syscall_s390_guarded_storage;
+extern struct syscallentry syscall_s390_sthyi;
 
 unsigned int random_fcntl_setfl_flags(void);
Signature · 1 line
2.14.3