From patchwork Sat Jun 20 13:42:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 31560 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5KDpoVk005356 for ; Sat, 20 Jun 2009 13:51:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751078AbZFTNvp (ORCPT ); Sat, 20 Jun 2009 09:51:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751383AbZFTNvo (ORCPT ); Sat, 20 Jun 2009 09:51:44 -0400 Received: from cs20.apochromatic.org ([204.152.189.161]:64933 "EHLO cs20.apochromatic.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751078AbZFTNvo (ORCPT ); Sat, 20 Jun 2009 09:51:44 -0400 X-Greylist: delayed 544 seconds by postgrey-1.27 at vger.kernel.org; Sat, 20 Jun 2009 09:51:44 EDT Received: from localhost (localhost [127.0.0.1]) by cs20.apochromatic.org (Postfix) with ESMTP id 6C131AD95C; Sat, 20 Jun 2009 06:42:43 -0700 (PDT) From: Matt Fleming To: linux-sh@vger.kernel.org Cc: lethal@linux-sh.org, Matt Fleming Subject: [PATCH] sh: Save and restore the syscall number around trace_hardirqs_on Date: Sat, 20 Jun 2009 14:42:42 +0100 Message-Id: <1245505362-21036-1-git-send-email-matt@console-pimps.org> X-Mailer: git-send-email 1.6.3.2.316.gda4e Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org When performing a syscall on SH we store the syscall number in register r3, which according to the ABI isn't callee-saved. I was running into a problem where trace_hardirqs_on would trash the value in r3 and the syscall handlers were not being called. So save/restore the contents of r3 on the stack around the call to trace_hardirqs_on. Signed-off-by: Matt Fleming --- arch/sh/kernel/entry-common.S | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index d62359c..9c3ec36 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S @@ -322,9 +322,17 @@ ENTRY(system_call) nop #ifdef CONFIG_TRACE_IRQFLAGS + /* + * Save r3 (the syscall number) on the stack because it + * may be clobbered by the call to trace_hardirqs_on. + */ + mov.l r3, @-r15 + mov.l 5f, r10 jsr @r10 nop + + mov.l @r15+, r3 ! restore r3 #endif sti