LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/4] MN10300: Call update_process_times() outside of the xtime_lock
@ 2008-02-19 18:58 David Howells
  2008-02-19 18:58 ` [PATCH 2/4] MN10300: Introduce barriers to replace removed volatiles in gdbstub David Howells
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Howells @ 2008-02-19 18:58 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, dhowells

Call update_process_times() outside of the xtime_lock.  Somewhere somewhere
inside one of the functions called by that, xtime_lock is readlocked, which
ends up in a deadlock situation.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/mn10300/kernel/time.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c
index ff492e3..babb7c2 100644
--- a/arch/mn10300/kernel/time.c
+++ b/arch/mn10300/kernel/time.c
@@ -84,11 +84,13 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
 		/* advance the kernel's time tracking system */
 		profile_tick(CPU_PROFILING);
 		do_timer(1);
-		update_process_times(user_mode(get_irq_regs()));
 		check_rtc_time();
 	}
 
 	write_sequnlock(&xtime_lock);
+
+	update_process_times(user_mode(get_irq_regs()));
+
 	return IRQ_HANDLED;
 }
 


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

* [PATCH 2/4] MN10300: Introduce barriers to replace removed volatiles in gdbstub
  2008-02-19 18:58 [PATCH 1/4] MN10300: Call update_process_times() outside of the xtime_lock David Howells
@ 2008-02-19 18:58 ` David Howells
  2008-02-19 18:58 ` [PATCH 3/4] MN10300: Make the kernel jump into gdbstub on a BUG David Howells
  2008-02-19 18:59 ` [PATCH 4/4] MN10300: Update asb2303_defconfig David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2008-02-19 18:58 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, dhowells

Introduce into the MN10300 gdbstub a couple of barrier() calls to replace the
removed volatility of the input/output index variables for the Rx ring buffer.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/mn10300/kernel/gdb-io-ttysm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/arch/mn10300/kernel/gdb-io-ttysm.c b/arch/mn10300/kernel/gdb-io-ttysm.c
index c545159..e94c25e 100644
--- a/arch/mn10300/kernel/gdb-io-ttysm.c
+++ b/arch/mn10300/kernel/gdb-io-ttysm.c
@@ -196,6 +196,7 @@ int gdbstub_io_rx_char(unsigned char *_ch, int nonblock)
 try_again:
 	/* pull chars out of the buffer */
 	ix = gdbstub_rx_outp;
+	barrier();
 	if (ix == gdbstub_rx_inp) {
 		if (nonblock)
 			return -EAGAIN;
@@ -207,6 +208,7 @@ try_again:
 
 	ch = gdbstub_rx_buffer[ix++];
 	st = gdbstub_rx_buffer[ix++];
+	barrier();
 	gdbstub_rx_outp = ix & (PAGE_SIZE - 1);
 
 	st &= SC01STR_RXF | SC01STR_RBF | SC01STR_FEF | SC01STR_PEF |


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

* [PATCH 3/4] MN10300: Make the kernel jump into gdbstub on a BUG
  2008-02-19 18:58 [PATCH 1/4] MN10300: Call update_process_times() outside of the xtime_lock David Howells
  2008-02-19 18:58 ` [PATCH 2/4] MN10300: Introduce barriers to replace removed volatiles in gdbstub David Howells
@ 2008-02-19 18:58 ` David Howells
  2008-02-19 18:59 ` [PATCH 4/4] MN10300: Update asb2303_defconfig David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2008-02-19 18:58 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, dhowells

Make the kernel jump into gdbstub (if configured) on a BUG with the register
set from the BUG rather than interpolating another illegal instruction and
leaving gdbstub's idea of the process counter in unsupported_syscall() where
the original BUG was detected.

With this patch, gdbstub reports a SIGABRT to the compiler and reports the
program counter at the original BUG, allowing the execution state at the time
of the BUG to be examined with GDB.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/mn10300/kernel/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c
index 8b9dc6d..fcb9a03 100644
--- a/arch/mn10300/kernel/traps.c
+++ b/arch/mn10300/kernel/traps.c
@@ -391,7 +391,7 @@ static asmlinkage void unsupported_syscall(struct pt_regs *regs,
 	if (code == EXCEP_SYSCALL15 && !user_mode(regs)) {
 		if (report_bug(regs->pc, regs) == BUG_TRAP_TYPE_BUG) {
 #ifdef CONFIG_GDBSTUB
-			__gdbstub_bug_trap();
+			gdbstub_intercept(regs, code);
 #endif
 		}
 	}


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

* [PATCH 4/4] MN10300: Update asb2303_defconfig
  2008-02-19 18:58 [PATCH 1/4] MN10300: Call update_process_times() outside of the xtime_lock David Howells
  2008-02-19 18:58 ` [PATCH 2/4] MN10300: Introduce barriers to replace removed volatiles in gdbstub David Howells
  2008-02-19 18:58 ` [PATCH 3/4] MN10300: Make the kernel jump into gdbstub on a BUG David Howells
@ 2008-02-19 18:59 ` David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2008-02-19 18:59 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-am33-list, linux-kernel, dhowells

Update the ASB2303 default configuration.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/mn10300/configs/asb2303_defconfig |   33 +++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 9 deletions(-)


diff --git a/arch/mn10300/configs/asb2303_defconfig b/arch/mn10300/configs/asb2303_defconfig
index ca9876a..3aa8906 100644
--- a/arch/mn10300/configs/asb2303_defconfig
+++ b/arch/mn10300/configs/asb2303_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc2
-# Fri Nov 16 13:36:38 2007
+# Linux kernel version: 2.6.25-rc2
+# Tue Feb 19 18:52:24 2008
 #
 CONFIG_MN10300=y
 CONFIG_AM33=y
@@ -21,6 +21,7 @@ CONFIG_ARCH_HAS_ILOG2_U32=y
 # CONFIG_ARCH_SUPPORTS_AOUT is not set
 CONFIG_GENERIC_HARDIRQS=y
 # CONFIG_HOTPLUG_CPU is not set
+CONFIG_HZ=1000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -38,15 +39,16 @@ CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-# CONFIG_FAIR_GROUP_SCHED is not set
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_USER_SCHED is not set
+# CONFIG_CGROUP_SCHED is not set
 # CONFIG_SYSFS_DEPRECATED is not set
 # CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -57,22 +59,33 @@ CONFIG_SYSCTL_SYSCALL=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=y
+# CONFIG_HAVE_OPROFILE is not set
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_MODULES is not set
 # CONFIG_BLOCK is not set
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
 
 #
 # Matsushita MN10300 system setup
@@ -206,6 +219,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
@@ -311,6 +325,8 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 # CONFIG_PARPORT is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HAVE_IDE is not set
 
 #
 # SCSI device support
@@ -345,7 +361,6 @@ CONFIG_SMC91X=y
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -405,6 +420,7 @@ CONFIG_RTC=y
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
 # CONFIG_WATCHDOG is not set
 
 #
@@ -444,6 +460,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_SOUND is not set
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
 # CONFIG_RTC_CLASS is not set
 
@@ -455,10 +472,10 @@ CONFIG_SSB_POSSIBLE=y
 #
 # File systems
 #
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -554,5 +571,3 @@ CONFIG_HAS_DMA=y
 #
 # Profiling support
 #
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=y


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

end of thread, other threads:[~2008-02-19 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-19 18:58 [PATCH 1/4] MN10300: Call update_process_times() outside of the xtime_lock David Howells
2008-02-19 18:58 ` [PATCH 2/4] MN10300: Introduce barriers to replace removed volatiles in gdbstub David Howells
2008-02-19 18:58 ` [PATCH 3/4] MN10300: Make the kernel jump into gdbstub on a BUG David Howells
2008-02-19 18:59 ` [PATCH 4/4] MN10300: Update asb2303_defconfig David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).