From patchwork Thu Jan 8 01:16:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 17267 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id A8D4BDE70C for ; Thu, 8 Jan 2009 12:16:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbZAHBQs (ORCPT ); Wed, 7 Jan 2009 20:16:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752394AbZAHBQs (ORCPT ); Wed, 7 Jan 2009 20:16:48 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:47559 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752200AbZAHBQr (ORCPT ); Wed, 7 Jan 2009 20:16:47 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 4E770C8C28D; Wed, 7 Jan 2009 17:16:49 -0800 (PST) Date: Wed, 07 Jan 2009 17:16:49 -0800 (PST) Message-Id: <20090107.171649.174783717.davem@davemloft.net> To: sam@ravnborg.org Cc: sparclinux@vger.kernel.org, rostedt@goodmis.org Subject: Re: [PATCH] sparc: refactor code in fault_32.c From: David Miller In-Reply-To: <20090106210624.GB29514@uranus.ravnborg.org> References: <20090106205209.GA24034@uranus.ravnborg.org> <20090106.125249.214296726.davem@davemloft.net> <20090106210624.GB29514@uranus.ravnborg.org> X-Mailer: Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Sam Ravnborg Date: Tue, 6 Jan 2009 22:06:24 +0100 > So outstanding issues now are: > > 1) How to fix "warning" in unaligned_64.c (get_user() || get_user()) I'm going to put a hack patch in, similar to your's, so people can get work done. We can try to cure this situation more cleanly later. sparc64: Work around branch tracer warning. As reported by Sam Ravnborg, Gcc-3.4.5 does not handle: if (get_user() || get_user()) with the new branch tracer enabled. Just seperate it out into seperate statements for now so people can get work done. Signed-off-by: David S. Miller --- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c index 203ddfa..f164d5a 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c @@ -601,11 +601,15 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr pc = (u32)pc; if (get_user(insn, (u32 __user *) pc) != -EFAULT) { int asi = decode_asi(insn, regs); + int err; + if ((asi > ASI_SNFL) || (asi < ASI_P)) goto daex; - if (get_user(first, (u32 __user *)sfar) || - get_user(second, (u32 __user *)(sfar + 4))) { + err = get_user(first, (u32 __user *)sfar); + if (!err) + err = get_user(second, (u32 __user *)(sfar + 4)); + if (err) { if (asi & 0x2) /* NF */ { first = 0; second = 0; } else