Skip to contentSkip to conversation

s390: core changes.

PATCH In review Martin Schwidefsky 1 participant 1 message Nov 30, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 s390: core changes.

[patch 1/6] s390: core changes.

From: Martin Schwidefsky <[email protected]>
From: Ulrich Weigand <[email protected]>

s390 core changes:
- Remove defines for kernel_stack_size and async_stack_size.
- Reserve system call number for kexec.
- Add cc-option check for new gcc option packed-stack.
- Fix race on no_hz_cpu_mask in stop_hz_timer.
- Fix ptrace to make it send a SIGTRAP before the first instruction of a single stepped signal handler is executed.
- Use force_sig_info with a full siginfo structure for illegal operation.
- Remove verbatim copy of si_codes from asm-s390/siginfo.h. Use the generic definitions.
- Regenerate default configuration.

diffstat:

 arch/s390/Makefile          |   12 +++++++
 arch/s390/defconfig         |    6 +--
 arch/s390/kernel/entry.S    |    2 +
 arch/s390/kernel/entry64.S  |    2 +
 arch/s390/kernel/ptrace.c   |    5 ++-
 arch/s390/kernel/syscalls.S |    3 +
 arch/s390/kernel/time.c     |    7 +++-
 arch/s390/kernel/traps.c    |   68 ++++++++++++++++++++++++++----------------
 include/asm-s390/siginfo.h  |   71 --------------------------------------------
 include/asm-s390/unistd.h   |    3 +
 10 files changed, 75 insertions(+), 104 deletions(-)
arch/s390/defconfig +3 -3
diff -urN linux-2.6/arch/s390/defconfig linux-2.6-patched/arch/s390/defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.10-rc1
-# Thu Nov 11 12:54:21 2004
+# Linux kernel version: 2.6.10-rc2
+# Tue Nov 30 14:00:30 2004
 #
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -147,7 +147,6 @@
 # SCSI low-level drivers
 #
 # CONFIG_SCSI_SATA is not set
-# CONFIG_SCSI_QLOGIC_1280_1040 is not set
 # CONFIG_SCSI_DEBUG is not set
 CONFIG_ZFCP=y
 CONFIG_CCW=y
@@ -197,6 +196,7 @@
 CONFIG_MD_RAID5=m
 # CONFIG_MD_RAID6 is not set
 CONFIG_MD_MULTIPATH=m
+# CONFIG_MD_FAULTY is not set
 # CONFIG_BLK_DEV_DM is not set
 
 #
arch/s390/kernel/entry64.S +2 -0
diff -urN linux-2.6/arch/s390/kernel/entry64.S linux-2.6-patched/arch/s390/kernel/entry64.S
@@ -231,6 +231,8 @@
 	brasl	%r14,do_signal    # call do_signal
 	tm	__TI_flags+7(%r9),_TIF_RESTART_SVC
 	jo	sysc_restart
+	tm	__TI_flags+7(%r9),_TIF_SINGLE_STEP
+	jo	sysc_singlestep
 	j	sysc_leave        # out of here, do NOT recheck
 
 #
arch/s390/kernel/entry.S +2 -0
diff -urN linux-2.6/arch/s390/kernel/entry.S linux-2.6-patched/arch/s390/kernel/entry.S
@@ -229,6 +229,8 @@
 	basr	%r14,%r1               # call do_signal
 	tm	__TI_flags+3(%r9),_TIF_RESTART_SVC
 	bo	BASED(sysc_restart)
+	tm	__TI_flags+3(%r9),_TIF_SINGLE_STEP
+	bo	BASED(sysc_singlestep)
 	b	BASED(sysc_leave)      # out of here, do NOT recheck
 
 #
arch/s390/kernel/ptrace.c +4 -1
diff -urN linux-2.6/arch/s390/kernel/ptrace.c linux-2.6-patched/arch/s390/kernel/ptrace.c
@@ -640,7 +640,10 @@
 			return -EIO;
 		clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 		child->exit_code = data;
-		set_single_step(child);
+		if (data)
+			set_tsk_thread_flag(child, TIF_SINGLE_STEP);
+		else
+			set_single_step(child);
 		/* give it a chance to run. */
 		wake_up_process(child);
 		return 0;
arch/s390/kernel/syscalls.S +2 -1
diff -urN linux-2.6/arch/s390/kernel/syscalls.S linux-2.6-patched/arch/s390/kernel/syscalls.S
@@ -283,5 +283,6 @@
 SYSCALL(sys_mq_unlink,sys_mq_unlink,sys32_mq_unlink_wrapper)
 SYSCALL(sys_mq_timedsend,sys_mq_timedsend,compat_sys_mq_timedsend_wrapper)
 SYSCALL(sys_mq_timedreceive,sys_mq_timedreceive,compat_sys_mq_timedreceive_wrapper)
-SYSCALL(sys_mq_notify,sys_mq_notify,compat_sys_mq_notify_wrapper)
+SYSCALL(sys_mq_notify,sys_mq_notify,compat_sys_mq_notify_wrapper) /* 275 */
 SYSCALL(sys_mq_getsetattr,sys_mq_getsetattr,compat_sys_mq_getsetattr_wrapper)
+NI_SYSCALL							/* reserved for kexec */
arch/s390/kernel/time.c +5 -2
diff -urN linux-2.6/arch/s390/kernel/time.c linux-2.6-patched/arch/s390/kernel/time.c
@@ -260,18 +260,21 @@
 	if (sysctl_hz_timer != 0)
 		return;
 
+	cpu_set(smp_processor_id(), nohz_cpu_mask);
+
 	/*
 	 * Leave the clock comparator set up for the next timer
 	 * tick if either rcu or a softirq is pending.
 	 */
-	if (rcu_pending(smp_processor_id()) || local_softirq_pending())
+	if (rcu_pending(smp_processor_id()) || local_softirq_pending()) {
+		cpu_clear(smp_processor_id(), nohz_cpu_mask);
 		return;
+	}
 
 	/*
 	 * This cpu is going really idle. Set up the clock comparator
 	 * for the next event.
 	 */
-	cpu_set(smp_processor_id(), nohz_cpu_mask);
 	timer = (__u64) (next_timer_interrupt() - jiffies) + jiffies_64;
 	timer = jiffies_timer_cc + timer * CLK_TICKS_PER_JIFFY;
 	asm volatile ("SCKC %0" : : "m" (timer));
arch/s390/kernel/traps.c +43 -25

108 lines not on this page · raw message

arch/s390/Makefile +12 -0
diff -urN linux-2.6/arch/s390/Makefile linux-2.6-patched/arch/s390/Makefile
@@ -34,6 +34,7 @@
 cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
 cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
 
+# old style option for packed stacks
 ifeq ($(call cc-option-yn,-mkernel-backchain),y)
 cflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
 aflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
@@ -44,6 +45,17 @@
 endif
 endif
 
+# new style option for packed stacks
+ifeq ($(call cc-option-yn,-mpacked-stack),y)
+cflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
+aflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
+cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
+aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
+ifdef CONFIG_SMALL_STACK
+STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
+endif
+endif
+
 ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
 cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
 cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
include/asm-s390/siginfo.h +0 -71

81 lines not on this page · raw message

include/asm-s390/unistd.h +2 -1
diff -urN linux-2.6/include/asm-s390/unistd.h linux-2.6-patched/include/asm-s390/unistd.h
@@ -269,8 +269,9 @@
 #define __NR_mq_timedreceive	274
 #define __NR_mq_notify		275
 #define __NR_mq_getsetattr	276
+/* Number 277 is reserved for new sys_kexec_load */
 
-#define NR_syscalls 277
+#define NR_syscalls 278
 
 /* 
  * There are some system calls that are not present on 64 bit, some